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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

SUMX total is not adding up correctly

I'm having issue where I'm trying to get totals based on two columns and it's not multiplying correctly, I tried following the solution in: https://community.powerbi.com/t5/Desktop/Help-with-SUMX-Calculating-Total-Sales/m-p/501410#M234002  which the OP has same similar problem as mine. However, one of my columns is based on a COUNT formula using a measure and is not available as a column to use with the SUM formula. I can't create the COUNT formula as a column since it then tries add up everything in the table. Or maybe I'm going about it the wrong way. The first column is commission rate (Storefront_Commission) and second column is Qty (CountSalesCode) and last column is total (Total Commission Amt Due).

 

My measure for last column is:

Total Commission Amt Due = SUMX(All_AMS_Sales, All_AMS_Sales[CountSalesCode] * RELATED(Product_Billing[STOREFRONT_COMMISSION]) 

 

I've highlighted all the ones in yellow that are totaling up incorrectly. 

 

SUMX_IncorrectTotals.png

 

I've confirmed the qty columns are set to whole numbers and 1st and 3rd column are set to US Currency with 2 decimal places. I'm using the COUNT because I need to add up product in the original sales order record and cannot rely using the qty in the sales order record because if someone ordered 2 items, we only pay commission once per order.

 

Thanks!

 

 

2 REPLIES 2
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please share me some dummy sample data, not real data, for test.

 

 

Best Regards,

Icey

 

Greg_Deckler
Super User
Super User

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.