Column total incorrect for converted amounts

SUNNY ISLAND

New Member
Joined
Nov 1, 2006
Messages
13
I have the following dax formula to convert values from various currencies to SGD. The total column does not add up. Instead of showing $16.5m, it is showing $25.2m. The converted amount on each row is correct but not the total for the column.

As I'm fairly new to DAX, appreciate assistance on how to get the following DAX formula working. A copy of my model is attached below.
-----
Total value in SGD =
VAR
_CURRENCY = MAX(Data[Report curr])
VAR
_CONVERSIONRATE =
calculate(max('Exch rate'[Exch rate]), 'Exch rate'[Report Curr] = _CURRENCY)
RETURN
sumx(data,_CONVERSIONRATE*(Data[Value]))
----

2022-08-31_16-51-16.png

1662080622856.png
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Your grand total is not simply a sum of the values above it, it uses the same measure as every other row. So you're getting one conversion rate - for whatever MAX(Data[Report curr]) returns - applied to the total of Data[Value]. See Alberto's article here: Summing values for the total - SQLBI
 
Upvote 0
Solution

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top