Forum Discussion
Sumtotal Currency Conversion Problem
- 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.
Hi oslosa
I don't quite get it.
Is Curr_adj_value a measure? How exactly are you using it?
Can you clarify this?
This works fine for the individual rows in the table, however, the sumtotal is wrong.
Is table a table visual? Is sumtotal the total in the visual for the measure? What's in each indivdual row?
Could you share the pbix?
An example would help
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers ![]()
Hi, yes, Curr_adj_value is a measure. It is connected to two datasets, one is a list wil projects and their cost in local currency, the other is a list of exchange rates for different currencies at different points in time.
The measure is supposed to return the project cost in Local currency when the local currency box is checked and in NOK when the NOK box is checked. When creating a visual, a table, with project names and cost, the measure works perfectly for each individual project in the list, each row. However, the sum total, i.e. the bottom row, returns a bogus number after the conversion to NOK.
The DAX code has to treat this bottom row separately in order for it to work, i.e. that the sumtotal matches the sum of the individual rows/projects, but I need help in writing this part of the DAX code.