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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DavidS524
Helper I
Helper I

Running Total of Running Total - DAX Help

Hi everyone,

 

I am working with a report where a rolling sum is being calculated with the following measure:

RollingSum = CALCULATE (
    SUM ( Table1[InitialValue]),
    FILTER (
        ALLSELECTED ( Table1 ),
        Table1[enddate] <= MAX ( Table1[enddate] )
    )
)
 
What I need is an additonal measure which calculates the rolling sum of the first rolling sum. Since the first rolling sum is a measure itself, I can't quite sort out how to do this in DAX. Any ideas?

 

Thank you!

 

InitialValueRollingSum MeasureI need this to be the rolling sum of the first RollingSum measureenddate
11112/31/2018
2343/31/2019
36106/30/2019
410209/30/2019
5153512/31/2019
2 REPLIES 2
Greg_Deckler
Super User
Super User

@DavidS524 This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.

 

Also, you might find the techniques used here valuable as it works with either a physical table or a virtual table (var). 

Better Running Total - Microsoft Fabric Community

Better Rolling Average - Microsoft Fabric Community


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks, Greg! I'll will take a look at this and try to come up with a solution.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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