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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

RANKX measure is ranking data from a relationship table that is not in my dataset

Hi All,

 

I have written this measure to rank my ID entries based on hit %.

 

Current Quarter Ranking = RANKX(DEXTR, [Hit %])
 
In another table, I have ID's and company names to help identify which companies are being referred to. In this table there are more companies and ID's than in dataset. This is where I believe my problem is arising. (e.g. ID 1 is company A, ID 2 is company B,..)
 
When I add the measure above to my table, it adds rows to my table for the other companies not referred to in my dataset. How can I avoid this?
 
The image below shows how the ranking is: 1) incorrect order (I want the highest % to be ranked higher). 2) Ranking extends for the CP_ID beyond those in the data set because of the above mentioned relationship table where I extract the company name from the ID.
rank help.png
 
Any help will be appreciated.
1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Assume you have tables

Capture2.JPGCapture3.JPG 

Create measures

Measure = SUM(Table1[percent])

Measure 2 = RANKX(ALL(Table2),[Measure],,DESC,Dense)

Capture1.JPG

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Assume you have tables

Capture2.JPGCapture3.JPG 

Create measures

Measure = SUM(Table1[percent])

Measure 2 = RANKX(ALL(Table2),[Measure],,DESC,Dense)

Capture1.JPG

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.