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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.