Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hi guys, I have been stuck with this and I need some help.
I am developing a visual to segment my data between two categories. One of them is the usual ABC analysis, where I need to identify where the total volume of my items reach 80% of the total volume. Those items will be labeled as A, then the next 15% (totalizing 95%) will be labeled as B and the rest of them are C.
What I did was first - Used the Rankx function to organize my items by volume:
Then, I just need the cumulative number of the volume based on the ranking. The original cumulative that I described earlier is giving me just hte volume of each row. so I redid it adding the new columns in the ALLSELECTED() as well:
Cumulative =
Which is weird, because if the Ranking was somehow returning 1 (its being calculated correctly for each row, as you guys can see in the images), the cumulative should return the value of the top1 item, not the volume of the item in the row (I tested using 1 as the first parameter n the TOPN() and this is exactly what happens). I have been stuck with this for so long I feel I cant find an answer, i am about to cry 😞
Can someone help me with some insights of what might be happening, I feel like its a context problem but I just cant understand.
Hi @Leandro_Filho ,
Rankx function, it ‘Returns the rank of an expression in the current context in the list of values for the expression evaluated for each row in the specified table’.
Please try changing ALLSELECTED to ALL in the measure.
If you want to sort the cumulative volume, then use the sumx function.
I recommend that you refer to the following links to learn how to use the RANKX function in the TOPN function:
Power BI Pro Tip: Pareto analysis with DAX / Power Pivot · Dutch Data Dude
Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
10 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
13 | |
12 | |
11 | |
9 |