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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

DAX Measure (Dynamic Cumulative Sum)

I want to create the cumulative total based on the rank (in this case a Measure Count), unfortunately I can't get it to work with this attempt. I always get the total and not the running total.
Do you have any idea how to do it?

Lines_Cum = 

VAR CURRENTRANK = [COUNT]

RETURN

SUMX(

    FILTER(

        ALL(FAKTWA_DAT),

        Currentrank <= MAXX(FaktWA_DAT,[Count])

        ),

        [LINES]

)
COUNT = RANKX(ALL(FaktWA_DAT),[AS_Index],,ASC,DENSE)-1

 

AyoubBo17_1-1685050008336.png

 


 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Anonymous Try:

Lines_Cum = 

VAR CURRENTRANK = [COUNT]

RETURN

SUMX(

    FILTER(

        ALL(FAKTWA_DAT),

        [Count] <= Currentrank 

        ),

        [LINES]

)


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

unfortunately it didn't work, I found another solution. (Index made in PQ and then SUMX with AS_LINES (dynamic Lines) but it only works for counts smaller than 1000. After that, the working memory has problems and displays an error message. 

Lines_Cum = 

SUMX(

       

    FILTER(

        ALL(FAKTWA_DAT),

        FaktWA_DAT[Index] <= MAX(FaktWA_DAT[Index])

        )

    ,[AS_Lines]

)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.