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
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
Super User
Super User

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