Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have 2 tables - Currency & Sales and they are connected by many to many relationship.
I have created a calculated column in Sales table, and it returns value for only one condition, where the period is equal to '20214'. For other rows, where the period is <> 20214, the values are blank. Below is my table structure & the DAX
Table Currency -
Field LCurrency FCurrency FXRate Type Period
yyyym EUr GBp 0.8545 AVRS 20214
USd GBp 1.1684 AVRS 20214
JPy Eur 0.8808 RNMJ 20214
Table Sales
Field Item Currency Sales Period Calculated Column Value
yyyym 0123 USd 10000 20214 8558.712
4567 USd 8000 20213 BLANK, value should be 6846.97
8787 EUr 2000 20216 BLANK, value should be 2340.55
DAX is:
'SALES'[Sales] *
DIVIDE(1,
CALCULATE(
FIRSTNONBLANK('Currency'[FXRate], TRUE() ),
FILTER(
'Currency'
'Currency'[LCurrency] = 'Sales'[Currency] &&
'Currency'[FCurrency] = "GBP" &&
'Currency'[Type] = "AVRS" &&
'Currency'[Period] = "20214")
)
)
Appreciate your help on this please.
Thanks,
Solved! Go to Solution.
Hi @Sai_Alkesh ,
Please remove any relationship between currency and sales table, and you can get the expected result...
Remove relationship
Best Regards
@Sai_Alkesh , If all rate rae there then you should compare period with period
'SALES'[Sales] *
DIVIDE(1,
CALCULATE(
FIRSTNONBLANK('Currency'[FXRate], TRUE() ),
FILTER(
'Currency'
'Currency'[LCurrency] = 'Sales'[Currency] &&
'Currency'[FCurrency] = "GBP" &&
'Currency'[Type] = 'sales'[Type] &&
'Currency'[Period] = sales[Period])
)
)
@amitchandak - it still gives the same result. The reason i have the period in the filter clause is, 'cos i want to get the inverse value of FX rate which is for that period. Once i get that rate, i want to multiply the sales from Sales table with this derived rate.
In the calculated column of Sales table, it shows me the result of the derived value, however it only shows where the period in sales table is '20214'
@amitchandak - yes, i do. The currency table has the budget rate which is set to period 20214 for various currencies, however they are valid for the full year.
In Sales tables, since we have sales by individual month, we want to multiply the monthly sales with the budget rate.
@Sai_Alkesh , if there valid for a full year.
I will add the year in both tables and join that instead of period
year = left([Period year],1)
@amitchandak , thanks for extending the support. I tried as suggested, however its the same output.
I even tried with lookupvalue, since Filter was iterative, hence leaving blanks for period other than 20214, however it doesnt work either.
Hi @Sai_Alkesh ,
Please remove any relationship between currency and sales table, and you can get the expected result...
Remove relationship
Best Regards
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |