Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sanai1505
Regular Visitor

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.

 

sanai1505_0-1655420600117.png

 

@punit

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
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]

vxiaotang_2-1655802576795.png

vxiaotang_0-1655802536345.png

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]

vxiaotang_3-1655802675706.png

 

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.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
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]

vxiaotang_2-1655802576795.png

vxiaotang_0-1655802536345.png

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]

vxiaotang_3-1655802675706.png

 

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.

VahidDM
Super User
Super User

Hi @sanai1505 

 

In Power BI desktop, open the Model tab, and check the columns type same as below:

VahidDM_0-1655423695506.png

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors