- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SUMX vs SUM gives different total - why and best practice
I have Raw data [Fiscal Qtr ending] & [Net Revenue]. I am trying to get PBI to return a {Total Net Revenue] "x numbers of days back". SO I use DAX ... Calculate(SUM, DATESINBETWEEN)
I started off using Calculate(SUMX , DATESINBETWEEN) - and I notice very small discrepancy (Refer image RED)
However, if I use Calculate(SUM, DATESINBETWEEN) it is correct..
I dont know if SUMX is the wrong DAX to use - clearly this is the case..
Can you help me understand why?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess the difference is that with SUM, if you have 100 rows of data, it can do it in a single operation.
Whereas with SUMX there will be 100 separate calcuations which then result in a final amount which opens the door for rounding issues????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To understand this you need to understand the functionality of both sum and sumx .if both of them were to give you the same result then why have 2 separate functions at all?
Sumx is iterative in nature and acts row by row.It does the calculation on the table you specify in the argument.For ex : if you write the below syntax
Sumx(financials, Unit_Price*Quantity)
Then sumx will go to the table financials,then for the 1st row multiply Unit_Price*Quantity and simply go to the second row for the same calculation .after all rows are over it does a sum on top of it.
Sum function simply adds up numeric column values and gives you the result in the visual based on other columns you select.
Sum works on a single column while sumx can work on multiple columns.
Found a simple video with indepth explanation that might help you more
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for sharing the guy explain very well with examples..!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Anonymous,
That is a very good question and lucky for you there is a very good answer here in this blog post by @MattAllington
http://exceleratorbi.com.au/sum-vs-sumx-in-dax/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Whilst the conclusion here is "Agregate a single column, use SUM".. do we know why in my examples SUMX returned a tiny discrepancy?
Thank you Phil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess the difference is that with SUM, if you have 100 rows of data, it can do it in a single operation.
Whereas with SUMX there will be 100 separate calcuations which then result in a final amount which opens the door for rounding issues????

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
09-10-2024 03:20 AM | |||
07-01-2024 07:20 AM | |||
09-14-2024 12:36 PM | |||
09-02-2024 05:13 PM | |||
09-14-2024 04:22 AM |
User | Count |
---|---|
88 | |
74 | |
63 | |
48 | |
36 |
User | Count |
---|---|
116 | |
86 | |
80 | |
59 | |
39 |