Forum Discussion

Dan80's avatar
Dan80
Helper II
9 years ago

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

 

VersionRegionTotal Sales Local CurrencyTotal Sales Base CurrencyFx RateFx Var 
BudgetUSA60010000.60  
BudgetEUR5009500.53  
ActualUSA4008000.50$133.33-$186.67
ActualEUR80012000.67-$320.00
       
Budget Summed110019500.56  
Actual Summed90017500.51$154.55 

7 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community 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?