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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
kjel
Frequent Visitor

Sum of subtotals is greater than the grand total

Hi, I have a measure which gives me the correct value for the grand total but when I try splitting it down into subtotals, the sum of the subtotals becomes greater than the grand total. I'm fairly sure that I'm messing something up w.r.t. the filter context but I'm fairly new to DAX and I can't find the error.

 

I have these two measures set up to calculate the LTM sum of my sales, meaning that for every month I want to calculate the total sales in that month and the previous 11 months. Pretty simple for historical months but in the current month I want to add my forecasted numbers to my actuals and in future months I want to show the forecasted numbers. These are the measures:

 

Remaining Sales Budget =
    CALCULATE(
        MAX( [Sales Budget Amount] - [Sales Amount],0 ),
        KEEPFILTERS( 'Date'[DateTime] >= DATE(YEAR(TODAY()),MONTH(TODAY()),1) )
    )
 
Sales&Budget LTM =
    CALCULATE(
        [Sales Amount] + [Remaining Sales Budget],
        DATESINPERIOD( 'Date'[DateTime],MAX('Date'[DateTime]),-12,MONTH )
    )
 

I hope my explanation makes sense. Anyway, I've checked and I get the correct LTM totals when using these measures UNTIL I try to create a visual that splits the total sales amount, for example by customer segment or product type.

Screenshot 2022-11-23 095342.png

 

The total at the bottom is the correct number, however the sum of the subtotals is 343,645,368 (not USD fyi)

 

 

 

 

 

Any ideas on how to fix this? Let me know if I need to provide more information 🙂

1 ACCEPTED SOLUTION
kjel
Frequent Visitor

Just wanted to add that I've resolved the issue, it was pretty simple: when looking at the totals I either under/overshoot my forecast and the LTM reflects that, however when I split the actuals and forecasted numbers I can underperform in some categories while overperforming in others and the MAX() function then makes the sum of the subtotals larger than the "grand total".

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Greate job!

kjel
Frequent Visitor

Just wanted to add that I've resolved the issue, it was pretty simple: when looking at the totals I either under/overshoot my forecast and the LTM reflects that, however when I split the actuals and forecasted numbers I can underperform in some categories while overperforming in others and the MAX() function then makes the sum of the subtotals larger than the "grand total".

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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