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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Why different totals?

Can anyone explain why these two formulas give different totals?    What is more confusing to me is that the 2nd measure (which gives the correct total) is actually referenced in the first measure...but the first measure not only gives wrong totals per month, but also wrong grand total.     Confused.  

 

 

Distinct Count of Zero Value Shipments = CALCULATE( DISTINCTCOUNT( 'Flu_Shipped Orders'[Order]),'Flu_Shipped Orders'[Zero or Revenue Shipment]="$0 Value Shipments")
 
Correct Totals Zero = SUMX(VALUES('Date Table'[Month]),[Distinct Count of Zero Value Shipments])
 
 
 

 

 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Note that your first measure total is less than the second.  That's because Totals are not Totals in Power BI.  It would be better to call them All Rows in that unlike each of the rows in the table that filters the data first, the "Total" does not have that filter, so all rows are included in the DISTINCTCOUNT() calculation.  Since you are more likely to have duplicates when more rows are included, the result is less.

 

The second measure is a common pattern you'll use and whole blogs have been written about it.  With that pattern, you create a virtual table of all the distinct values for each row and their distinctcounts, which is then summed up to get the correct total.

https://powerpivotpro.com/2010/02/sumx-the-5-point-palm-exploding-fxn-technique/

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

Note that your first measure total is less than the second.  That's because Totals are not Totals in Power BI.  It would be better to call them All Rows in that unlike each of the rows in the table that filters the data first, the "Total" does not have that filter, so all rows are included in the DISTINCTCOUNT() calculation.  Since you are more likely to have duplicates when more rows are included, the result is less.

 

The second measure is a common pattern you'll use and whole blogs have been written about it.  With that pattern, you create a virtual table of all the distinct values for each row and their distinctcounts, which is then summed up to get the correct total.

https://powerpivotpro.com/2010/02/sumx-the-5-point-palm-exploding-fxn-technique/

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

I am not sure if the picture can be seen, that was supposed to be in my original post.   

 

But here it is, below

 

totals.jpg

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors