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
PowerUser123
Helper II
Helper II

Cumulative Sum - Adjusted Value Each Day

So I created a measure called Win Loss which is just the sum of sales - 250,000 which can be seen in the 2nd column below. I wanted to create a running total of this win loss, but I don't think the measure is calculating correctly. It looks like it's taking the first day's sales less 250k, but then just adding total sales to that amount thereafter. What am I doing wrong?

 

PowerUser123_0-1647938307510.png

Win Loss Run = CALCULATE([Win Loss],FILTER(ALLSELECTED('Calendar'[Date]),'Calendar'[Date]<=MAX('Calendar'[Date])))

 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@PowerUser123 , Try like

 

Win Loss Run = CALCULATE(sumx(values('Calendar'[Date]),[Win Loss]),FILTER(ALLSELECTED('Calendar'[Date]),'Calendar'[Date]<=MAX('Calendar'[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

View solution in original post

davehus
Memorable Member
Memorable Member

Hi @PowerUser123 ,

 

Try this.

 

Running Total =
VarLastDate =LASTDATE('Date Table'[DateKey])
return CALCULATE(sum('Table'[Value]),ALLEXCEPT('Date Table','Date Table'[DateKey]),'Date Table'[DateKey]<=VarLastDate)

View solution in original post

3 REPLIES 3
PowerUser123
Helper II
Helper II

Both answers work great thank you!

davehus
Memorable Member
Memorable Member

Hi @PowerUser123 ,

 

Try this.

 

Running Total =
VarLastDate =LASTDATE('Date Table'[DateKey])
return CALCULATE(sum('Table'[Value]),ALLEXCEPT('Date Table','Date Table'[DateKey]),'Date Table'[DateKey]<=VarLastDate)
amitchandak
Super User
Super User

@PowerUser123 , Try like

 

Win Loss Run = CALCULATE(sumx(values('Calendar'[Date]),[Win Loss]),FILTER(ALLSELECTED('Calendar'[Date]),'Calendar'[Date]<=MAX('Calendar'[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

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.