Forum Discussion

sgannon1's avatar
sgannon1
Frequent Visitor
10 years ago
Solved

Convert currency

I need to convert the 'amount' column in the below table to EUR (currency is GBP at the moment), and then to merge the table with another that is already in EURO.  So far I have not been able to do ...
  • Greg_Deckler's avatar
    10 years ago

    This will work if you get rid of all of your non-GBP exchange rates. Do you need those? If you do, sure some more DAX magic can get you there.

     

    Column = LOOKUPVALUE(ExchangeRates[ExchangeRate],ExchangeRates[CurrencyCode],"GBP",ExchangeRates[StartTime],MAX(ExchangeRates[StartTime]))

    Oh wait, here is the additional DAX magic that will let you keep your other currency codes.

     

    Column = LOOKUPVALUE(ExchangeRates[ExchangeRate],ExchangeRates[CurrencyCode],"GBP",ExchangeRates[StartTime],CALCULATE(MAX(ExchangeRates[StartTime]),ExchangeRates[CurrencyCode]="GBP"))