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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
KeatonO
Helper II
Helper II

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

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

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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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

 

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

 

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
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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.