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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
roshenrrujj
Frequent Visitor

Overall weighted RANK of multiple RANKs

hey guys, could you PLEASE help me with this DAX query below? 

 

i have a list of contractors with multiple ranks and i need to produce the overall rank with weightings. However when i try multipling each RANK with its corresponding weighting, it gives top ranks to the contractors with a lot of blank ranks. 

 

Rank%Weighting
Rank 10.2
Rank 20.2
Rank 30.15
Rank 40.1
Rank 50.3
Rank 60.05

 

 
ContractorIDRank 1Rank 2Rank 3Rank 4Rank 5Rank 6
CON11120487142248
CON1121172158322
CON113623911  
CON11429956224
CON1158214232434242
CON11611814334342 
CON1171159328384222
CON1181061162934421
CON11910510925371233
CON1208915013242 
CON12110110817212734
CON1229113811101045
CON1231001067113344
CON124111741584245
CON1257110520244130
CON1263511013324254
CON127107968124218
CON128739723294213
CON12949137212542 
CON130778120284226
CON1315912118272325
CON13288727124249
CON133809517213616
CON134581312223227
CON135677924301151
CON13655146 1442 
CON13765103519753
CON1385311417253210
CON139120130    
CON140131345 4256
CON141548914123937
CON142108136    
CON14310     
CON1448     
CON145 7    
CON146  6  1
CON147 5    
CON148  5   
CON1495     
CON1504     
CON151 4    
CON152  4   
CON153 3    
CON1543     
CON155 2    
CON156     1
CON157     1
CON158      
CON159      
CON160      
CON161      
CON162      
CON163      
CON164      
CON165      
CON166      
CON167      
 

i produced each Rank with this DAX:

IF( ISBLANK(measure),
    BLANK(),
    RANKX(
        filter(
            ALL(DATA[ContractorID]),
            measure>0),
            measure,,
            ASC,
            Dense))


if this helps:
I have another report, in which i know that CON113, CON112 and CON111 are one of the top ranking contractors. 
 
1 REPLY 1
technolog
Super User
Super User

The problem you're facing is that when you're multiplying each rank by its weighting, contractors with many blank ranks are getting top ranks. This is because blank or missing ranks are being treated as 0, and when multiplied by the weighting, they don't affect the overall score. As a result, contractors with many blank ranks get an advantage.

To solve this, you need to calculate a weighted score for each contractor and then rank them based on this score. Here's how you can do it:

First, you need to calculate the weighted score for each contractor. For each rank column, you'll multiply the rank by its weighting. Then, sum up all these weighted scores for each contractor to get the overall score.

For example, for CON111, the weighted score would be:
(20 * 0.2) + (48 * 0.2) + (7 * 0.15) + (14 * 0.1) + (22 * 0.3) + (48 * 0.05)

Once you have the weighted score for each contractor, you can then rank them based on this score. The contractor with the lowest score (since lower ranks are better) will be ranked 1, the next lowest will be ranked 2, and so on.

Here's a DAX formula to calculate the weighted score for each contractor:

WeightedScore =
DATA[Rank 1] * 0.2 +
DATA[Rank 2] * 0.2 +
DATA[Rank 3] * 0.15 +
DATA[Rank 4] * 0.1 +
DATA[Rank 5] * 0.3 +
DATA[Rank 6] * 0.05
Now, you can rank the contractors based on this weighted score:

css
Copy code
WeightedRank =
RANKX(
ALL(DATA[ContractorID]),
[WeightedScore],
,
ASC,
Dense
)
This will give you a rank based on the weighted score, with the contractor having the lowest score ranked 1, and so on. This should solve your problem and give you a more accurate ranking of the contractors.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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