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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Cumulative / running total start at Zero based on Calender slicer

Hello,

 

Currently I'm using the measure below to calculate my running total sales. This works fine, except;

I would like recalculate the running total for each slicer adjustment. At the moment it starts the total based on latest results, but I would like to start at 0.

 

For example:

No slicer adjustment (working as intended):

MonthWeekCumSales
11100
12200
13300
14400
21450
22500
23550
24600

 

Current results when slicing to month 2 (not intended)

MonthWeekCumSales
21450
22500
23550
24600

 

Desired result when slicing to month 2

MonthWeekCumSales
2150
22100
23150
24200

 

CumSales =
if(
  MIN(Cal[Date]) <= CALCULATE(MAX(Sal[Sales date]); all('Sal'));
    CALCULATE(SUM('Sal'[Sales])+0
      ;FILTER(ALL(Cal[Date]);Cal[Date] <= MAX(Cal[Date])))

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I think I just found it!

 

CumSales =
if(
  MIN(Cal[Date]) <= CALCULATE(MAX(Sal[Sales date]); all('Sal'));
    CALCULATE(SUM('Sal'[Sales])+0
      ;FILTER(ALLSELECTED(Cal);Cal[Date] <= MAX(Cal[Date])))

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

Note quite following. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



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...
Anonymous
Not applicable

Thanks for your feedback Greg. Tried to make it clearer with examples instead of text.

This challenge took my entire day 🙂

Anonymous
Not applicable

I think I just found it!

 

CumSales =
if(
  MIN(Cal[Date]) <= CALCULATE(MAX(Sal[Sales date]); all('Sal'));
    CALCULATE(SUM('Sal'[Sales])+0
      ;FILTER(ALLSELECTED(Cal);Cal[Date] <= MAX(Cal[Date])))

Offtopic comment, but you saved my day!!!

Thank you! 🙂

Hi @Anonymous 

 

Glad that you've fixed it! please kindly mark it as the answer to help others find it more quickly. thanks!

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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