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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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):
| Month | Week | CumSales |
| 1 | 1 | 100 |
| 1 | 2 | 200 |
| 1 | 3 | 300 |
| 1 | 4 | 400 |
| 2 | 1 | 450 |
| 2 | 2 | 500 |
| 2 | 3 | 550 |
| 2 | 4 | 600 |
Current results when slicing to month 2 (not intended)
| Month | Week | CumSales |
| 2 | 1 | 450 |
| 2 | 2 | 500 |
| 2 | 3 | 550 |
| 2 | 4 | 600 |
Desired result when slicing to month 2
| Month | Week | CumSales |
| 2 | 1 | 50 |
| 2 | 2 | 100 |
| 2 | 3 | 150 |
| 2 | 4 | 200 |
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])))
)
Solved! Go to Solution.
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])))
)
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
Thanks for your feedback Greg. Tried to make it clearer with examples instead of text.
This challenge took my entire day 🙂
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!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!