Forum Discussion
How to convert currency?
Hi Everyone,
I'm new to Power BI and I'm having some trouble with changing the currency. Some of my data is in USD and some in CAD, I need to convert all the rental costs into USD.
Hi sanai1505
Thanks for reaching out to us.
When you have multiple currencies in your sales table, it is common practice to create a currency exchange rate table. Then perform currency conversion in the sales table according to the exchange rate in the rates table.
For example, you can create a custom USD column in Power Query Editor,
(let cur = [currency] in Table.SelectRows(rate, each [currency] = cur)){0}[rate] * [sale]Or you can create a column with DAX,
DAX Column = var _rate= CALCULATE(MAX('rate'[rate]),FILTER(ALL('rate'),'rate'[currency]= EARLIER('Table'[currency]))) return _rate*'Table'[sale]Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- v-xiaotang
Community Support
Hi sanai1505
Thanks for reaching out to us.
When you have multiple currencies in your sales table, it is common practice to create a currency exchange rate table. Then perform currency conversion in the sales table according to the exchange rate in the rates table.
For example, you can create a custom USD column in Power Query Editor,
(let cur = [currency] in Table.SelectRows(rate, each [currency] = cur)){0}[rate] * [sale]Or you can create a column with DAX,
DAX Column = var _rate= CALCULATE(MAX('rate'[rate]),FILTER(ALL('rate'),'rate'[currency]= EARLIER('Table'[currency]))) return _rate*'Table'[sale]Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.