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

Join 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.

Reply
wsuess
Frequent Visitor

Rankx problem

Hi to all,

I have problem with RankX, because the data formart, which i have to rank are text.See below screen shot

I have a second table, which i rank and  there i can use  it without problems, but these are decimal numbers.

 

ItemRank = RANKX(ALL('DataTable'[Part Number]),'DataTable'[Revenue1])
Is there any solution for?
Many thansk for your support

wsuess_0-1608548849702.png

 

6 REPLIES 6
amitchandak
Super User
Super User

@wsuess , Have tried

 

ItemRank = RANKX(ALL('Table'),'Table'[Part Number]) 

 

I did not see that

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

@wsuess , You should able to rank, what is error you are getting

 

ItemRank = RANKX(ALL('Table'[Part Number]),'Table'[Part Number])

or

ItemRank = RANKX(ALL('Table'),'Table'[Part Number])

or

ItemRank = RANKX(ALL('Table'),'Table'[Part Number],,asc,dense)

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns

https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello Amit,

see both results.

wsuess_1-1608556083348.png

 

wsuess_0-1608556076737.png

 

wsuess_2-1608556112528.png

 

The result are 1 in all lines

@wsuess , Tried this as a new column?

ItemRank = RANKX(ALL('Table'),'Table'[Part Number])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
AlB
Community Champion
Community Champion

Hi @wsuess 

What is the problem exactly? 

How would you like to sort/rank the text data? Following what rules?

Probably best to convert the text to number in a way that respects the order you want to observe

And best if you can share the pbix or some sample data like that shown in the pic but in text format so that it can be readily copied

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.