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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NNaj
Helper IV
Helper IV

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 @NNaj

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 @NNaj

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors