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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Cumulative count not working with slicer

Hi All,

 

I'm using the below measure to get a cumulative count of all planned items, however, when i use a slicer (Project Name), it doesn't slice the data correctly and it only shows me the cumulative count for the context in which the Project exists. 

 

I have tried using ALLSELECTED instead of ALL but this doesnt give me a cumulative count on my graph. 

 

Is anyone able to tell me how i can make sure that the data is still cumulating but when slicer is selected, it also cuts the data correctly? 

 

thanks all.

 

Cumulative Planned Total = CALCULATE(
[Total Planned],
FILTER(ALL('planner', 'planned'[date] <= MAX('planned[date])))
6 REPLIES 6
amitchandak
Super User
Super User

@Anonymous , I this should work with allselected or use date table and try

 

Cumulative Planned Total = CALCULATE(
[Total Planned],
FILTER(ALLselected('planner', 'planned'[date] <= MAX('planned'[date])))

 

 

or with date table
Cumulative Planned Total = CALCULATE(
[Total Planned],
FILTER(ALLselected('Date', 'Date'[date] <= MAX('Date'[date])))

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amit, 

 

thanks for your response. I tried to change the measures so that everything is calling on DimDate and my graph became broken and it wasn't cumulating. Please find attached the data and PBIX

 

Thanks

@Anonymous , Check this. And if I change this to all selected it working fine

 

Cumulative Planned = 
CALCULATE(
        [Total Planned], 
        FILTER(ALLSELECTED(Sheet1), Sheet1[Date] <= MAX(Sheet1[Date])))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

When i do it on my actual PBI, it works but the values for planned (for example) decrease and it doesn't add up to what it needs to add up to. Do you know why that could happen?

 

@Anonymous , please find the attached file after signature, Please highlight the error in the screenshot for the above measure

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amit, 

 

I think it's because i have a filter on my actual graph. I've filtered it so that the Planned line only shows up to the next month and when i use 'ALLSELECTED', it removes that context? Not sure if that's correct but that's what seems to be happening. 

 

When i add a relative date filter to the sample PBIX, it seems to alter what is being shown. Is there another way i can work around it?

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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