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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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