Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
DataSkills
Resolver I
Resolver I

SUMX total not "adding up"

Hi, I am confused about the result of a DAX formula that is giving an unexpected result. 

 

Notice how the totals for the 2 columns don't add up? This is a filtered table. 

 

DAX SUMX.jpg

Total care mins = sum(Table1[Scores])
Test = CALCULATE(sumx(values(Table1[PatientName]),max(Table1[Scores])))
 
The ACTUAL values from the data are:
Scores
129
99
246
213
243
 
I just cannot get my head around why these 2 totals are different. If I remove all the filters, they are still different so I don't think this is the reason.
 
What am I missing? 
 
Thanks
1 ACCEPTED SOLUTION
JW_van_Holst
Resolver IV
Resolver IV

In the total there is no filter on patient. Sumx is iterating over all 5 patients. While iterating it evaluates the second argument (MAX). Because there is no filter context it will evaluate every time the max of all patients (246). In the last step it will aggrate the five 246 in an sum (1260).

View solution in original post

2 REPLIES 2
DataSkills
Resolver I
Resolver I

Thank you JW_van_Holst! I now get where this number comes from. That makes sense to me. 

JW_van_Holst
Resolver IV
Resolver IV

In the total there is no filter on patient. Sumx is iterating over all 5 patients. While iterating it evaluates the second argument (MAX). Because there is no filter context it will evaluate every time the max of all patients (246). In the last step it will aggrate the five 246 in an sum (1260).

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.