Forum Discussion
sgannon1
10 years agoFrequent Visitor
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 ...
- 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"))
v-haibl-msft
10 years agoMicrosoft Employee
The solution provided by Greg_Deckler should work. And you can also try with following column formula.
Converted Amount_Column =
VAR LatestDate =
CALCULATE (
MAX ( 'Currency Conversion'[Starting Date] ),
'Currency Conversion'[Currency Code] = "GBP"
)
RETURN
(
CALCULATE (
VALUES ( 'Currency Conversion'[1.2 Exchange Rate Amount] ),
FILTER (
'Currency Conversion',
'Currency Conversion'[Currency Code] = "GBP"
&& 'Currency Conversion'[Starting Date] = LatestDate
)
)
* Table1[1.2 Amount]
)Best Regards,
Herbert