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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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.

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.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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