Forum Discussion
FX Variance calculation - SUMX doesn't work
Hi all,
I need to conduct variance analysis on some financials including the impact of changes in fx rates. The variance calculation is:
Actual Revenue_Base Currency - (Actual Revenue_Local Currency / Budget Fx Rate)
This is fine when there is only 2 currencies, however, in my data there is 10 different currencies and as a result the above calculation needs to be done at an individual row level and then 'summed up'. To do this, I used SUMX e.g.
SUMX(Table, Actual Revenue_Base Currency) - (SUMX(Table, Actual Revenue_Local Currency) / (SUMX(Table, Budget Revenue_Local Currency)/SUMX(Table, Budget Revenue_Base Currency))
Results are correct at an individual currency level, however, the total is completey wrong as it appears that for the grand total is recalculating the variance as opposed to 'summing up' the individual parts. A simple example is below, would appreciate any help. Thanks,
Dan
| Version | Region | Total Sales Local Currency | Total Sales Base Currency | Fx Rate | Fx Var | |
| Budget | USA | 600 | 1000 | 0.60 | ||
| Budget | EUR | 500 | 950 | 0.53 | ||
| Actual | USA | 400 | 800 | 0.50 | $133.33 | -$186.67 |
| Actual | EUR | 800 | 1200 | 0.67 | -$320.00 | |
| Budget | Summed | 1100 | 1950 | 0.56 | ||
| Actual | Summed | 900 | 1750 | 0.51 | $154.55 |
7 Replies
- Greg_DecklerCommunity Champion
Are you doing this as a measure? If so, the Total line in a table can be not what is expected because the Total link calculates not upon what is in the table but rather looking at all of the data (essentially removes the row level context. Generally this is able to be fixed with some additional DAX work. Can you post some mock data and then your expected result?
- Dan80Helper IIThanks for your reply and yes, I am trying to create a measure. The top 4 rows of the table in my original post is an example of the data, using these numbers I would expect the answer to be -$186.67 ie the sum of USA & EUR variances. Thanks
- Greg_DecklerCommunity Champion
OK, thanks for explaining your data, I'll try to recreate. In the meantime, check out my DAX tip "Dealing with Measures" here:
http://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/m-p/63376#U63376
It focuses on this exact problem.