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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Rearrange the cumulative based on the amount in descending order

Hello everyone,

 

I have a doubt in the calculation of the cumulative percentage (right column).

 

When I order the rows by the amount the metric stops working because it is created according to the alphabetical order of the customers. This cumulative column would have to add the value of that company plus all the previous ones, reaching the last row with 100%.

 

JorgeRG_0-1635943552116.png

 

Here is the measure I created for the running total:

 

Running Total=

var sales = CALCULATE (SUM ('table'[Amount]),

                                      FILTER (ALLSELECTED('table'[Customer]), ISONORAFTER ('table'[Customer], MAX ('table'[Customer]), DESC)))

 

var totalsales = CALCULATE (SUM ('table'[Amount]), ALLSELECTED ('table'))

 

Return

DIVIDE (sales, totalsales)

 

Any help is welcome 😀

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous,

Did AlexisOlson's suggestions help with your scenario? if that is the case, you can consider Kudo or accept his suggestions to help others who faced similar requirements.

If that also doesn't help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hello,

 

I followed this link to resolve it: Cumulative Running Total Based on Highest Value - Excelerator BI

 

Thanks @AlexisOlson anyway!

Anonymous
Not applicable

HI @Anonymous,

Thanks for sharing the solution about your scenario, I think they may help others who faced a similar requirement.😊

Regards,

Xiaoxin Sheng

AlexisOlson
Super User
Super User

If you want it ordered by amount, then use that ordering for the cumulative total.

 

Running Total =
VAR currAmount = SELECTEDVALUE ( 'table'[Amount] )
VAR sales =
    CALCULATE (
        SUM ( 'table'[Amount] ),
        FILTER ( ALLSELECTED ( 'table' ), 'table'[Amount] >= currAmount )
    )
VAR totalsales =
    CALCULATE ( SUM ( 'table'[Amount] ), ALLSELECTED ( 'table' ) )
RETURN
    DIVIDE ( sales, totalsales )

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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