Forum Discussion
Power bi( currency)
- 1 year ago
The issue arises because your formula may be encountering missing or zero values in the currency rate or mismatched relationships. Here's a simplified solution:
- Ensure the relationship between the tables (on the Country column) is correctly set up as one-to-many.U
- se this formula for a calculated column in the first table:
Sum_in_EUR = 'FirstTable'[AmountLocal] * RELATED('SecondTable'[CurrencyRate])The RELATED function pulls the matching CurrencyRate for each country.
Handle missing or zero currency rates to avoid errors:
Sum_in_EUR = IF( ISBLANK(RELATED('SecondTable'[CurrencyRate])) || RELATED('SecondTable'[CurrencyRate]) = 0, BLANK(), 'FirstTable'[AmountLocal] * RELATED('SecondTable'[CurrencyRate]) )Double-check that Country values match perfectly between tables (no typos or extra spaces).
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂
Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
Hi
Notice that you have created the relationship, then you can use the RELATED() function.
Try the following DAX:
Sum_in_EUR = SUMX(
'FirstTable',
'FirstTable'[Amount_Local] * RELATED('CurrencyTable'[Rate])
)Or you could merge these tables into one.