Currency Conversion Calculation: use most recent conversion rate to replace rate in future

  • Currency Conversion Calculation: use most recent conversion rate to replace rate in future

    Posted by DSC Communities on March 24, 2020 at 2:22 pm
    • Min Su

      Member

      March 24, 2020 at 2:22 PM

      Hi everyone,

      Ā 

      I am creating a measure to convert currency. The logic of currency conversion is that if the opportunity has a future close date, then use the most recent exchange rate.

      Ā 

      But my measure doesn’t show any conversion rate when there is a future close date.

      Ā 

      ConversionRate = CALCULATE(IF(ISBLANK(CALCULATE(FIRSTNONBLANK(VALUES(‘Dated Conversion Rate'[ConversionRate]), ‘Dated Conversion Rate'[ConversionRate]), FILTER(‘Dated Conversion Rate’,’Dated Conversion Rate'[StartDate] = FIRSTDATE(‘Opportunity'[CloseDate]) && ‘Dated Conversion Rate'[IsoCode] = FIRSTNONBLANK(‘Opportunity’ [CurrencyIsoCode], ‘Opportunity’ [CurrencyIsoCode])))), LOOKUPVALUE(‘Currency Type'[ConversionRate], ‘Currency Type'[IsoCode], FIRSTNONBLANK(‘Opportunity’ [CurrencyIsoCode], ‘Opportunity’ [CurrencyIsoCode])), CALCULATE(FIRSTNONBLANK(VALUES(‘Dated Conversion Rate'[ConversionRate]), ‘Dated Conversion Rate'[ConversionRate]), FILTER(‘Dated Conversion Rate’,’Dated Conversion Rate'[StartDate] = FIRSTDATE(‘Opportunity'[CloseDate]) && ‘Dated Conversion Rate'[IsoCode] = FIRSTNONBLANK(‘Opportunity’ [CurrencyIsoCode], ‘Opportunity'[CurrencyIsoCode])))))
      Ā 
      Ā 
      CloseDate is located in the opportunity table; NNARR revenue is located in the opportunity product table and Startdate is the key to link opportunity table and date table.
      The date models between tables used:

      Ā 

      Ā Thanks!

      Ā 

      Ā 

      Ā 

      Ā 

      Ā 

      Ā 

      Ā 

      Ā 

      Thanks!

    • Ashley Hsia

      Member

      March 25, 2020 at 10:03 AM

      Hi Min Su,

      It would help if you could provide a sample of the data table you are working with.Ā  You mention future date – does this mean there is an actual date in the future Power BI can look at or is anything in the future simply blank?Ā 
      If you do have dates ?some of the logic in this post might be helpful:

      https://community.powerbi.com/t5/Desktop/Calcuate-the-closest-less-than-date/td-p/21113

      You may also want to try using the NOW() function to say if date is less than NOW(), use closest rate, etc.
      Best of luck,

      ——————————
      AHsia
      ——————————
      ——————————————-

    • Min Su

      Member

      March 25, 2020 at 11:54 AM

      Hi Ashley,

      There is an actual date in the future power bi can look up.Ā 
      Here is the opportunity table in which I would like to create a conversionRate calculated column.

      Here is the dated conversion rate table that storages updated conversion rate information. In a single day, there are conversion rates for multiple currencies. Ā 

      Thanks,
      Zimin

      ——————————
      Min Su
      Sales Operation Analyst
      Washington DC
      ——————————
      ——————————————-

    DSC Communities replied 5 years, 5 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Currency Conversion Calculation: use most recent conversion rate to replace rate in future’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!