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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Aggregation discrepancies inside same table

I have one table 'ticket sales' containing the ticket_id, line_idproduct_id, price, quantity, date and turnover

 

I want to analyze the total turnover of 2020.

First I put a filter visual filtering on date between '2020-01-01' and '2020-12-31'.

Then I create a table visual where I drag the turnover column, which should automatically aggregate the turnover by summing all values of the turnover column where the date is filtered. 

However, when I also drag the date column in the same table, so I get the turnover per day, the total row at the bottom of the visual differs from the total I get when I only have the turnover field in the table. 

 

See the screenshot below. Note that I redacted the concrete numbers. 

 

slambrecht_1-1641483933504.png

 

I also checked the DAX statements behind these two tables:

 

 // First value
DEFINE
  VAR __DS0FilterTable = 
    FILTER(
      KEEPFILTERS(VALUES('sales'[date])),
      AND('sales'[date] >= DATE(2020, 1, 1), 'sales'[date] <= DATE(2020, 12, 31))
    )

EVALUATE
  SUMMARIZECOLUMNS(
    __DS0FilterTable,
    "SumTurnover", CALCULATE(SUM('sales'[turnover]))
    )

 

 // Second table
DEFINE
  VAR __DS0FilterTable = 
    FILTER(
      KEEPFILTERS(VALUES('sales'[date])),
      AND('sales'[date] >= DATE(2020, 1, 1), 'sales'[date] <= DATE(2020, 12, 31))
    )

 EVALUATE 
    SUMMARIZECOLUMNS(
      ROLLUPADDISSUBTOTAL('sales'[date], "IsGrandateotalRowTotal"),
      __DS0FilterTable,
      "SumTurnover", CALCULATE(SUM('sales'[turnover])))
   

 

Could someone explain why there is a discrepancy between the two total values? Which one is correct?

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I managed to find the issue. 

It turned out that the turnover column contained a massively large number, once positive and once negative. Probably something that was wrongly scanned in the POS and then cancelled. 

 

As a result, the ticket looked like this:

+ 1 quadrillion

- 1 quadrillion

----------------

Total turnover = 0

 

After removing this ticket, the aggregation is correct. I suspect it has something to do with DAX that only allows for a certain number of digits for its numeric values. For instance 123456789 is 'rounded' to 123456000. 

 

Thank you @AlexisOlson. I managed to find it while I was experimenting with a dummy file because of your request. 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I managed to find the issue. 

It turned out that the turnover column contained a massively large number, once positive and once negative. Probably something that was wrongly scanned in the POS and then cancelled. 

 

As a result, the ticket looked like this:

+ 1 quadrillion

- 1 quadrillion

----------------

Total turnover = 0

 

After removing this ticket, the aggregation is correct. I suspect it has something to do with DAX that only allows for a certain number of digits for its numeric values. For instance 123456789 is 'rounded' to 123456000. 

 

Thank you @AlexisOlson. I managed to find it while I was experimenting with a dummy file because of your request. 

VahidDM
Super User
Super User

Hi @Anonymous 

 

Can you change the 'sales'[date] <= DATE(2020, 12, 31) to 'sales'[date] <DATE(2021, 1, 1) then check the result?

It might be because of the hours, add hours to your slicer date and check it again.

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

AlexisOlson
Super User
Super User

This looks strange indeed. Can you create a dummy file that reproduces this problem?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.