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
xtremus
New Member

Ranking based on a complex Measure

Hello comunity, I'm needing help to create a ranking measure based on another measure that calculates data from several tables.

 

The report I'm working on have at least 9 different tables all conected through DirectQuery bringing data from a corporate server, each table represents data for Different KPI's determining the performance on vendors from the operation. I created the following measure to determine an Overall performance for each vendor based on the scores they get on each KPI.

 

Performance = ('Table1'[KPI1]*0.2)+('Table2'[KPI2]*0.2)+('Table3'[KPI3]*0.2)+('Table4'[KPI4]*0.2)+('Table5'[KPI5]*0.2)
This is a resumed example on how the measure is built.
Each table is related to the others based on a Vendor ID linked also to a VendorTable with this same Vendor ID and other information of the vendor
 
The performance can give me a score from 0.00 to 1.00 based on the scores and then converted to % which means 0% to 100% overall performance.
 
From this point what I need to do next is to create a ranking for each vendor based on the Overall Performance score they get. I tried the following 
 
Ranking = RANKX(ALLSELECTED('VendorsTable'[VendorName]),'Table1'[Performance]) but is giving me only 1's 
also tried the following
Ranking = RANKX(ALLSELECTED('Table1'),'Table1'[Performance]) but it gives me an inaccurate ranking, I tried this way since the measure is located in Table1 even tho it brings information from several tables.
 
The desired output is the following.
VendorPerformanceRanking
Jhon98.92%1
Roger87.50%

2

Sara

75.69%3
Paul62.34%4

 

If you could provide any guidance or support on how can I handle this task it will be greatly appreciated.

 

Thanks much!

1 ACCEPTED SOLUTION
xtremus
New Member

Hello again community. 

 

While writting this post and giving it a depper though I figured that to work properly the performance measure and the ranking needed to be located in the 'VendorsTable' and not in the 'Table1' don't know exactly why but the ranking is working properly now. The DAX sentence I ended up using is:

 

Ranking = RANKX(ALLSELECTED('VendorsTable'),[Performance])
 
Hope this helps anyone in a similar situation.

View solution in original post

1 REPLY 1
xtremus
New Member

Hello again community. 

 

While writting this post and giving it a depper though I figured that to work properly the performance measure and the ranking needed to be located in the 'VendorsTable' and not in the 'Table1' don't know exactly why but the ranking is working properly now. The DAX sentence I ended up using is:

 

Ranking = RANKX(ALLSELECTED('VendorsTable'),[Performance])
 
Hope this helps anyone in a similar situation.

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