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, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
NSC7
Helper I
Helper I

Cumulative total based on sorting order of count total

Hi All,

 

I have a SQL data source which has multiple columns and many rows, I want to get cumulative total. I have tried several Dax formulas, but nothing is giving me desired result. For my requirement out of many columns i have to use RootCause and MissedCount column and I want to calculate Cumulative total % on descending sort order of MissedCount.

 

I am able to get cumulative total on sorting order of RootCause using below formula but i want to calculate Cumulative total % based on sorting order of MissedCount.

 

Cumlative % =
var MissedC=CALCULATE(SUM(Table[MissedCount]),FILTER(ALLSELECTED(Table[RootCause]),ISONORAFTER(Table[RootCause],Max(Table[RootCause]),DESC)))
var totalMissedC=CALCULATE(SUM(Table[MissedCount]),ALLSELECTED(Table))
return DIVIDE(MissedC,totalMissedC)

 

Expected Cumulative %-

 

NSC7_0-1677679672397.png

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @NSC7 ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1677822309939.png

2. create measure with below dax formula

Measure =
VAR cur_mc =
    SELECTEDVALUE ( 'Table'[Missed Count] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Missed Count] >= cur_mc )
RETURN
    SUMX ( tmp, [Total %] )

3. add a table visual with fields and measure 

vbinbinyumsft_2-1677822410540.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
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

1 REPLY 1
Anonymous
Not applicable

Hi @NSC7 ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1677822309939.png

2. create measure with below dax formula

Measure =
VAR cur_mc =
    SELECTEDVALUE ( 'Table'[Missed Count] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Missed Count] >= cur_mc )
RETURN
    SUMX ( tmp, [Total %] )

3. add a table visual with fields and measure 

vbinbinyumsft_2-1677822410540.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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