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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.