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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
AliceW
Impactful Individual
Impactful Individual

Cumulative Total per Account

Hello everyone,

I know, yet another post on Cumulative Total, but for the life of me I can't figure out how to make it work using the existing posts.

Sooo, I have two tables:

  • Accounts (one line per Account)
  • Opps (1 Account can have 0, 1, or more Opps)

I have this measure:

Amount = calculate(sum('Opps'[Amount]))
 
I then created
% of total =
divide(
[Amount],
calculate(
[Amount],
ALLSELECTED('Accounts')
)
)
 
What I can't get is the Cumulative Amount... Like this:
 
AccountAmount% of TotalCumulative Amount
Apples100045%1000
Pears70032%1700
Oranges50023%2200
TOTAL2200100% 
 

Can anyone help, please?

Thank you,

Alice

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @AliceW ,

 

You can use the CUMULATIVE_SUM function to calculate the cumulative sum of a measure. Here is an example of how you can use it:

Cumulative Amount =
CALCULATE (
    SUM ( 'Opps'[Amount] ),
    FILTER (
        ALL ( 'Accounts' ),
        'Accounts'[Account] <= MAX ( 'Accounts'[Account] )
    )
)


This measure will calculate the cumulative sum of the Amount column from the Opps table for each row in the Accounts table, based on the Account column.

You can then use this measure in a pivot table or matrix visualization to display the cumulative amount for each account, like this:

vhenrykmstf_0-1671181977751.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

View solution in original post

2 REPLIES 2
AliceW
Impactful Individual
Impactful Individual

Thank you, Henryk!!

v-henryk-mstf
Community Support
Community Support

Hi @AliceW ,

 

You can use the CUMULATIVE_SUM function to calculate the cumulative sum of a measure. Here is an example of how you can use it:

Cumulative Amount =
CALCULATE (
    SUM ( 'Opps'[Amount] ),
    FILTER (
        ALL ( 'Accounts' ),
        'Accounts'[Account] <= MAX ( 'Accounts'[Account] )
    )
)


This measure will calculate the cumulative sum of the Amount column from the Opps table for each row in the Accounts table, based on the Account column.

You can then use this measure in a pivot table or matrix visualization to display the cumulative amount for each account, like this:

vhenrykmstf_0-1671181977751.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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