Forum Discussion

oslosa's avatar
oslosa
Helper I
6 years ago
Solved

Sumtotal Currency Conversion Problem

Hi, I am doing a currency conversion with a double lookup that matches on both currency and time. This works fine for the individual rows in the table, however, the sumtotal is wrong. I found that on...
  • oslosa's avatar
    6 years ago

    Solved it!

    Curr_adj = IF(HASONEVALUE('Project list'[Cost]);
    SUM('Project list'[Cost])*LOOKUPVALUE(Currencies[NOK per unit];Currencies[Currency];MAX('Project list'[Currency]);Currencies[Year];YEAR(MAX('Project list'[Start date])));
    SUMX('Project list';CALCULATE(SUM('Project list'[Cost])*LOOKUPVALUE(Currencies[NOK per unit];Currencies[Currency];MAX('Project list'[Currency]);Currencies[Year];YEAR(MAX('Project list'[Start date]))))))
     
    The solution was a combination of SUMX and CALCULATE.