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
Anonymous
Not applicable

Cumulative Sum by User not working properly

Hi there! 

I want to look at the cumulative amount of savings ([savings]) by user ([external_payment_id]) over time ([event_month]).

It's working for 1 or 2 specific users when I filter the plot on the user's id.

However, the cumulative sum doesn't make sense at all when I select all users. 

 

I don't understand why it's working for a couple of random users, and not all. 

Do you guys have an idea?

 

Here is the code below as well as the plots shows on PowerBI

 

CumulativeSavings =
CALCULATE(
SUM('monthly_user_metrics'[savings]),
FILTER(
ALLEXCEPT('monthly_user_metrics', 'monthly_user_metrics'[external_payment_id]),
'monthly_user_metrics'[event_month] <= MAX('monthly_user_metrics'[event_month])
)
)

 

Screenshot 2024-08-14 at 16.27.21.pngScreenshot 2024-08-14 at 16.27.32.png

 

Thank you so much for your help!


2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@Anonymous Try Better Running Total. Better Running Total - Microsoft Fabric Community



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Anonymous
Not applicable

Hi @Anonymous, thank you so much for taking the time to test the issue on your own! I believe that there are some issues when I take into acconts a lot of users or some weird users I have in my database.

it's good to know that I got the right way though! 

 

thank you so much! 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous , Greg_Deckler, thank you for your prompt reply!

 

I did a sample test based on your description, but was unable to reproduce your issue.

vyajiewanmsft_0-1723786226781.png

vyajiewanmsft_1-1723786241268.pngPlease check my test pbix to see if I missed anything, and if possible you can also upload your example file for better testing.


Thank you for your understanding!

 

Best regards,

Joyce

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

Anonymous
Not applicable

Hi @Anonymous, thank you so much for taking the time to test the issue on your own! I believe that there are some issues when I take into acconts a lot of users or some weird users I have in my database.

it's good to know that I got the right way though! 

 

thank you so much! 

Greg_Deckler
Super User
Super User

@Anonymous Try Better Running Total. Better Running Total - Microsoft Fabric Community



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

hey @Greg_Deckler, I tried the running total, but it looks like it doesn't cumulate sum properly. 

here is the code I used to get the following chart:

 

RunningTotalSavings2bis =
CALCULATE(
DIVIDE(SUM(monthly_user_metrics[savings]), DISTINCTCOUNT(monthly_user_metrics[external_payment_id]),0),
FILTER(
ALL('monthly_user_metrics'[mss]),
'monthly_user_metrics'[mss] <= MAX('monthly_user_metrics'[mss])
)
)

Screenshot 2024-08-16 at 12.38.51.png


do you have an idea why?

thank you so much!

Jacques

Anonymous
Not applicable

hi @Greg_Deckler, thank you for replying!

I've tried your solution and it looks like it's working properly.

thank you so much! 

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 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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