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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
francisthe63
Helper I
Helper I

Cumulative sum for a summarize variable in DAX

Hello, 

 

I have a problem 

 

in my original table i had a measure that cumulates value in time and where filters works, it's : 

CALCULATE(
SUM(table[Value]),

ALL(Date table),

FILTER(ALLSELECTED(Table[Date],Table[Date] <= DATE TABLE[Date]))

I have another table  where the summarize results in the roiginal table
VAR _t1 = SUMMARIZE(new table,table[ID] (where id is Value + Key + Date),"Date",MAX(New table[Date]) etc ..;

 

Difference between Old table and new table is that the new table is the old table but with duplicates 

 

I try to get back my cumulatives values but i don't know how to do this

 

I tried

 

CALCULATE(SUMX(_t1,[Value]),ALL(date table),FILTER(_t1,[Date]<=MAX(date table[date]))

 

But it don't work because it don't cumulates my value and don't have value that i had before 

 

Do you know how to fix this problem ?

 

Thnak you in advance

4 REPLIES 4
Anonymous
Not applicable

Hi @francisthe63 ,

 

Try the following expression:

Cumulative Value = 
VAR CurrentDate = MAX('Date Table'[Date])
VAR FilteredTable = FILTER(
    ALL('Date Table'),
    'Date Table'[Date] <= CurrentDate
)
RETURN
SUMX(
    FILTER(
        _t1,
        [Date] IN VALUES(FilteredTable[Date])
    ),
    [Value]
)

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

Hello

 

It don't work on the step : VALUES(FilteredTable[Date]) because he don't want to recognize FilteredTable ...

Anonymous
Not applicable

Hi @francisthe63 ,

 

Not quite sure what you mean, what is the error message it reports?

 

Best regards,
Community Support Team_ Scott Chang

Greg_Deckler
Community Champion
Community Champion

@francisthe63 No need for CALCULATE, just use a SUMX and your FILTER.



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...

Helpful resources

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

June 2025 community update carousel

Fabric Community Update - June 2025

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