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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
aking11
Regular Visitor

RANKX help - ranking by first digit of number?

not sure what is going on here.. but used RANKX in a calculated column to add into a table for a report. 

 

Function here: 

Rank = VAR ThisGroup =  'FA Base Transfer List'[Preference#1] 
RETURN 
    RANKX(Filter('FA Base Transfer List','FA Base Transfer List'[Preference#1] = ThisGroup), 'FA Base Transfer List'[Seniority], ,ASC,Dense)

I am wanting to rank the list of employees by seniority number... the lowest seniority number is the lowest rank. It seems that it is only looking at the first or maybe first and second digit? 477 should be rank #1, not #5 after 4664. Is it something with 3 digit numbers vs 4 digit??

 

And this is what happens:

aking11_0-1690907238248.png

Thanks so much for the help!!!

1 ACCEPTED SOLUTION
kpost
Super User
Super User

Maybe it's a text field instead of a number field and that's why?  It is correctly sorted, alphabetically.  But not numerically.



//Mediocre Power BI Advice but hey, it's free//

View solution in original post

2 REPLIES 2
kpost
Super User
Super User

Maybe it's a text field instead of a number field and that's why?  It is correctly sorted, alphabetically.  But not numerically.



//Mediocre Power BI Advice but hey, it's free//

duh! thank you!! 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.