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

Cumulative Total for Pareto Using RANKX

Hi All,

 

I need help in creating a measure to calculate cumulative total. I was able to do it in my other report and I'm trying to replicte it. Not sure what is wrong but the cumulative total is showing the total for all instead.

 

Here's the dataset i used for a table called Pareto (the dataset is exported from a calculated table using ADDCOLUMNS and SUMMARIZE)

https://www.dropbox.com/s/ze7ac9001jsm1h1/Pareto.xlsx?dl=0

 

I created a calculated column for the rank

Questions Ranking = 
RANKX ( Pareto, Pareto[Occurence] )

And this measure for cumulative ranking

Cumulative Callout Occurence = 
CALCULATE (
    sum(Pareto[Occurence]),
    FILTER (
        ALLSELECTED ( Pareto ),
        Pareto[Questions Ranking]
            <= MAX ( Pareto[Questions Ranking] )
    )
)

It supposed to show cumulative total based on  ranking  but the measure is showing overall total. 

The first table in the image below is by Questions, the  second one is by rank

 

cumulative total.png

Thanks in advance for the help!










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@danextian

 

In this scenario, you want to analyze on Question Level, when you calculate "cumulative total based on  ranking", this "ranking" should be group on Question Level. So your ranking column should be like: 

 

Questions Ranking = 
RANKX ( ALL(Pareto[Questions]), CALCULATE(SUM(Pareto[Occurence]),ALLEXCEPT(Pareto,Pareto[Questions])),,DESC,Dense)

Then you cumulative total measure should work properly. 

 

43.PNG

 

Regards,

View solution in original post

1 REPLY 1
v-sihou-msft
Employee
Employee

@danextian

 

In this scenario, you want to analyze on Question Level, when you calculate "cumulative total based on  ranking", this "ranking" should be group on Question Level. So your ranking column should be like: 

 

Questions Ranking = 
RANKX ( ALL(Pareto[Questions]), CALCULATE(SUM(Pareto[Occurence]),ALLEXCEPT(Pareto,Pareto[Questions])),,DESC,Dense)

Then you cumulative total measure should work properly. 

 

43.PNG

 

Regards,

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.