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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
FZOU
Helper IV
Helper IV

Running total

Hello community,

 

I need your help lease is such a problem i'm calculating a running total it's work fine but with a weird comportment.

Running tot.PNG

Until the above picture everything is ok but when i move the filter to start from 15/02/2018 the cumul column ignoer the value of 01/02/2018 and start from 1200 like the picture below

Running fil.PNG

 

my desired result is if i move the slicer is still take the value of previous date like this table below, i need your help and thank you

Sales DateDemandQtCumul
15/02/201812002200
24/02/201815003700
15/04/201810004700
Total47004700

 

this is my formula : 

Cumul = CALCULATE(SUM(Demand[DemandQt]);FILTER(ALLSELECTED(demand);Demand[Sales Date]<=max(Demand[Sales Date])))
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@FZOU 

if you use allselected it will take the selected dates , you can use all or datestyd as per need

 

Cumul = CALCULATE(SUM(Demand[DemandQt]);FILTER(ALL(demand);Demand[Sales Date]<=max(Demand[Sales Date])))

Cumul = CALCULATE(SUM(Demand[DemandQt]);datesytd('Date'[Date])

Cumul = CALCULATE(SUM(Demand[DemandQt]);datesytd('Date'[Date],"1/31")// force year from Feb

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@FZOU 

if you use allselected it will take the selected dates , you can use all or datestyd as per need

 

Cumul = CALCULATE(SUM(Demand[DemandQt]);FILTER(ALL(demand);Demand[Sales Date]<=max(Demand[Sales Date])))

Cumul = CALCULATE(SUM(Demand[DemandQt]);datesytd('Date'[Date])

Cumul = CALCULATE(SUM(Demand[DemandQt]);datesytd('Date'[Date],"1/31")// force year from Feb

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

@amitchandak  thank you very much for your fast response, it work,i'm still confused with ALL and ALL selected

@FZOU , refer this one

https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept...

https://www.sqlbi.com/articles/the-definitive-guide-to-allselected/

 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.