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

Cumulative sum of a measure on line chart

Hi there,

 

I have following measure that counts distinct clients for a condition:

M1 = CALCULATE(DISTINCTCOUNT(table(client_id), filter(table,table[Served?] ="Yes" )) 

I want to show cumulative sum values over months(I have a datedim table) of this measure on a line chart.

Please suggest how can I do it?

 

My sample pbi file: https://1drv.ms/u/s!Ag919_pO_UKrgQbUO5qfsTPxwfY8?e=gmwvsD

 

Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

This is resolved!. Solution is :

CALCULATE(DISTINCTCOUNT(clientid), FILTER(ALL(Datedim[Date]),Datedim[Date] <= MAX(testtable[date])), testtable[served]="Yes" )

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

This is resolved!. Solution is :

CALCULATE(DISTINCTCOUNT(clientid), FILTER(ALL(Datedim[Date]),Datedim[Date] <= MAX(testtable[date])), testtable[served]="Yes" )

AlB
Community Champion
Community Champion

Hi @Anonymous 

Place YEar-Month in the axis of the visual and use this measure:

M1 =
CALCULATE (
    DISTINCTCOUNT ( table[client_id)] ),
    FILTER ( table, table[Served?] = "Yes" ),
    FILTER ( ALL ( DateTable ), DateTable[Date] <= MAX ( DateTable[Date] ) )
)

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

Anonymous
Not applicable

@AlB Sorry this solution doesn't provide Cumulative sum, it just gives the distinct count. Please check the sample pbi that I have now provided in the post.

Anonymous
Not applicable

@Anonymous Find a sample report here

 

 

Appreciate your kudos!! Mark my post as solution if this works.

Anonymous
Not applicable

@Anonymous sorry I dont have access to the location of the file you shared. Is there any other way that you can share the file?

Anonymous
Not applicable

@Anonymous  Try accesing this link - PBIX 

 

Appreciate your kudos!! Mark my post as solution if this helps.

Anonymous
Not applicable

@Anonymous thanks for resharing the link. But it doesnt provide me with the solution I am looking for. I need a dax to get cumulative sum of a measure not a column. I have attached my sample pbi. 

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.