Forum Discussion
Create a measure for currency
Hello,
I have a table with currency.
I have another table (budget) where amout is set in customer currency
so i want to create a column in the Budget table thta calculate amount in CAD for example based on customer currency and exchange rate table.
I can't figure how to do this.
10 Replies
- amitchandak
Super User
ferreros , You can get the value in the second table like
New column = maxx(filter(Currency, budget[currency iso code= "CAD"), [Conversion Rate])
You can add a new column and add more conditions in the filter as per need.
refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8- ferrerosFrequent Visitor
ok so it is not working as expected , because it brings the max value from currency table and it is not the CAD one
- ferrerosFrequent Visitor
Om i will try that to add the value in the budget table, but then i need to create a measure to calculate ammount only if currency of customer is not CAD
- v-jingzhang
Community Support
Hi ferreros
Do you mean you want to convert all amount values into CAD ones from their original currency code displayed in CurrencyIsoCode? If so, we need conversion rate between all other currencies and CAD. But from the currency table, I only see IsoCode column and ConversionRate column, so I'm not sure these conversion rates are between which two currencies?
In addition, this blog may be helpful: Currency conversion in Power BI reports - SQLBI
Best Regards,
Community Support Team _ Jing- ferrerosFrequent Visitor
Yes that is what i want but let say to make it all in USD, as it is the main Currency actually in our system, then i will be able to convert in CAD because i have the exchange rate of it
- v-jingzhang
Community Support
Hi ferreros
You can first create a column in Budget table which converts all amounts into USD.
Amount in USD = VAR vRate = MAXX ( FILTER ( 'Exchange Rate', 'Exchange Rate'[IsoCode] = Budget[CurrencyIsoCode] ), 'Exchange Rate'[ConversionRate] ) RETURN DIVIDE ( Budget[Amount], vRate )Then create a measure to convert USD amount into other currencies. This measure is dynamic. If you don't pick any currency code, it will return USD amount by default.
Measure = SUM(Budget[Amount in USD]) * SELECTEDVALUE('Exchange Rate'[ConversionRate],1)Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.