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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

RANX Issues

Hello there, this is my first post. I have spent hours trying to figure this out. I have watched videos and tried all kinds of variations myself. For some reason, I can only get a 1 or a 2 to return on my rank. My assumption is that my sum formula is too complex or that there is an issue because my filter is a lookup from another table. 

I need to rank based on sum revenue, sum dials, and sum talktime, all separate. Looking at revenue specifically, here is my formula.

 

Revenue Rank = RANKX(ALL('Invoiced Sales Data - ZCA_ProfitabilityAnalysis'[Role]),[Rep Revenue])
 
Role is a lookup from a roster table 
Rep Revenue is a calculate sum with multiple filters.
 Name is also a lookup from the roster table
 
I am trying to produce 
Name            Revenue        Rank
John Doe        5,000             1
Alex Danger    4,000             2
etc 
 
and highlight the bottom 20%
I can stack rank the revenue to show what I need but need a rank so I can later add the rankings and divide by total ranks to get a productivity score. the issue is, I am stuck on step one and cannot for the life of me return anything other than a 1 or 2 for every entry. Joe and Alex will both be a 1 or a 2. 
 
I have tried 
Revenue Rank = RANKX(ALLSELECTED('Invoiced Sales Data - ZCA_ProfitabilityAnalysis'[Role]),[Rep Revenue])
Revenue Rank = RANKX(ALL('Invoiced Sales Data - ZCA_ProfitabilityAnalysis'[Role]),[Rep Revenue],,DESC, Dense)))
Revenue Rank = RANKX(ALL('Invoiced Sales Data - ZCA_ProfitabilityAnalysis'[Role]),CALCULATE([Rep Revenue]))
Revenue Rank = RANKX(ALL('Invoiced Sales Data - ZCA_ProfitabilityAnalysis'),[Rep Revenue])
And just about every variation between these possible I can think of.
 
This is taking much longer than I expected and am now nearing my deadline, please help. 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

I FIGURED IT OUT!!!!! Oh my gosh, such relief right now, it was such a simple fix. image.png

I changed the grouping from role to name and then added a filter to the visual for the group I was looking for. Thanks for all of your help. 🙂

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

Difficult to troubleshoot without example data. Perhaps this will help: https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452

 

Otherwise, Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thank you for the valuable links. Hopefully this will help you further. I did try the suggestions you provided with the "what the hell ranx" formulas to no avail. 

 

 

image.png

 

image.png

 

image.png

 

Anonymous
Not applicable

Sorry, the invoiced sales data is also a line by line detail of who placed what order and the amount the order was sold for. This is the current formula being displayed in the image above. image.png

 

Anonymous
Not applicable

I FIGURED IT OUT!!!!! Oh my gosh, such relief right now, it was such a simple fix. image.png

I changed the grouping from role to name and then added a filter to the visual for the group I was looking for. Thanks for all of your help. 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.