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
01_RAF_01
Frequent Visitor

Running total with measure

Hi, im not sure if this is possible so hope someone can give some answer on it. 

I have a measure and it results in this:
1.PNG

2.PNG

 

 

However i need the running total / cummulate the amounts... in this case : 

 

days after today 44,88,132,176, etc etc ...


I thought by using this part i should be able to cummulate all the previous numbers :
"DIM_Dates[Date] >= maxdate,

ALL(DIM_Dates)))"

Would appreciate some help if its possible to calculate running totals based on measures, like i posted above instead of "sum" etc..
2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

Your variable MA is fixed once calculated, so putting it inside the CALCULATE doens't get you new numbers.  Try deleting that variable and replace MA with whatever your desired calculation is (e.g., SUM of a column?) in your Return. 

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


I tried that but also doesnt get me the result. 

Maybe better to decribe the total calculations/measures: 

1) I have a measure that counts the nrs of rows in a (filtered) table. (measure 1)

measure1= 
CALCULATE( COUNT('abc'[def]),
FILTER('abc',
NOT( 'abc'[ghi]= "1" && 'abc'[jkl] = "2" ) ))


2) from that measure i calculate the 30days MA (measure 2)

measure2=

VAR Datum = MAX(DIM_Dates[Date])
RETURN
If(Datum > TODAY(), BLANK(), CALCULATE(
AVERAGEX(
DATESINPERIOD(DIM_Dates[Date],
MAX(DIM_Dates[Date]),
-30, DAY), CALCULATE([measure1],DIM_Dates[Werkdag]=1)),DIM_Dates[Date]=TODAY()) )

2) from that measure i want to have the running totals starting today, just like here https://www.sqlbi.com/articles/computing-running-totals-in-dax/  (Runningtotal)

Runningtotal= 

VAR maxdate = MAX(DIM_Dates[Date])
return
CALCULATE(
[measure2],
DIM_Dates[Date] <= maxdate,
ALL(DIM_Dates )))

1.PNG



still getting the same number instead of it cumulating.... 

Helpful resources

Announcements
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!

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.