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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
plerner16
New Member

Column Subtotal Issue

I have a measure that pulls Actuals data from Jan-Current Month and Forecasted data for the rest of the year with a formula: 

CALCULATE(IF(
    Max(Master_Date[Daily]) <= Today(),
    Sheet1[Actuals],
    Sheet1[FCST]))

The issue is that when I filter on the full year, it only shows Forecast totals, but if I filter down to August (The last month of Actuals) then it'll show me the correct Subtotal for Jan-Aug. I need to figure out how to make it show me Jan-Dec subtotals where it sums Jan-Aug Actuals and then Sep-Dec Actuals.
1 ACCEPTED SOLUTION
AmiraBedh
Super User
Super User

The problem here is that when you filter to the full year, the context of your measure doesn't know how to differentiate between months that should use `Actuals` and those that should use `Forecasted` data.

You need to iterate through each day in your current context and determine whether to take `Actuals` or `Forecasted` data for that day.

One approach is to use the `SUMX` function.

Total Actuals and Forecast =
SUMX (
VALUES ( Master_Date[Daily] ),
IF (
Master_Date[Daily] <= TODAY(),
CALCULATE ( SUM ( Sheet1[Actuals] ) ),
CALCULATE ( SUM ( Sheet1[FCST] ) )
)
)

Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@plerner16 I agree with @AmiraBedh, adding some content here that may help you understand what is going on. First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
AmiraBedh
Super User
Super User

The problem here is that when you filter to the full year, the context of your measure doesn't know how to differentiate between months that should use `Actuals` and those that should use `Forecasted` data.

You need to iterate through each day in your current context and determine whether to take `Actuals` or `Forecasted` data for that day.

One approach is to use the `SUMX` function.

Total Actuals and Forecast =
SUMX (
VALUES ( Master_Date[Daily] ),
IF (
Master_Date[Daily] <= TODAY(),
CALCULATE ( SUM ( Sheet1[Actuals] ) ),
CALCULATE ( SUM ( Sheet1[FCST] ) )
)
)

Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors