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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Travis_rh
Frequent Visitor

RANKX by ID but return Name?

Hi,

 

I originally wrote a RANKX measure based on Company Name and their overall_score. Each company only has one score, but given that a measure has to be aggregate of some kind, I used SUM. However, it turns out some companies have identical names, and as a result, their rank is calculated based on their combined score.

 

RANKX Measure.jpg

 

So, I'm trying to write essentially the same rank measure but based on the company's ID field. However, when I try to pull that into a visual with company name, it doesn't work. The only filter context is a Top N parameter. 

 

Top N Parameter.jpg

 

Thank you,

 

-Travis

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Travis_rh , Not very clear

 

Try lIke

 

rankx(allselected(Summary[Company_id], Company[Name]), [overall score],,desc,dense)

 

refer if needed

https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
Power BI Rank Across dimension tables: https://youtu.be/X59qp5gfQoA

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Travis_rh , Not very clear

 

Try lIke

 

rankx(allselected(Summary[Company_id], Company[Name]), [overall score],,desc,dense)

 

refer if needed

https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
Power BI Rank Across dimension tables: https://youtu.be/X59qp5gfQoA

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

Thank you.

 

I marked as the solution, but there is a caveat - it only functions if I have the Industry slicer set to a specific value rather than "all." 

 

I forgot to mention in my original post that there are two other slicers on the page, but they were not set to anything. So, perhaps it was a sort of conflict with the ALLSELECTED() not including those other slicers? 

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!