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
sizi
Helper II
Helper II

DAX to define Overall rank based on 2different Ranks

Hello All,

 

I need to define rank for each employee based on average of 2 defined ranks.

 

Below is the original data:

EmployeeTaskRankSLAAvg(Task+SLA)
John232.5
claire423
Chris444
Rock264
Bella634.5
Harry714
Stefanie153

The result overall rank shall be based on Avg values:

EmployeeTaskRankSLAAvg(Task+SLA)Overall Rank
John232.51
claire4232
Chris4443
Rock2643
Bella634.54
Harry7143
Stefanie1532

 

Kindly help. Thanks in advance.

 

9 REPLIES 9
v-tianyich-msft
Community Support
Community Support

Hi @sizi ,

 

Try the following expression:

Rank = var _t = ADDCOLUMNS('Table',"Rank",RANKX(ALL('Table'),[AVG],,ASC,Dense))
RETURN MAXX(_t,[Rank])

vtianyichmsft_0-1705989212045.png

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

Below is the data detaile data and how  the calculation is done. Task rank is defined based on total task ; Avg sla is sla complaint task against task qulaified for SLA out of Total task and the result is defined rank and then task rank + sla rank gives the overall avg which again is defined to get the final rank.

EmployeeTotal Task TaskRankTask Qualified for SLASLA Complaint Task out of QualifiedAvg of sla complaint Avg SLA rank Total Rank Avg (TaskRank+AvgSLARankFinal Rank
John2717342.85714286322
claire1645240444
Chris222548011.51
Rock145635023.55
Bella1166350246
Harry573133.33333333567
Stefanie193425022.53

It isnt working for me. Task rank, sla rank is all measure defined from measures. I dont know the dax doesnt work for me 😞

v-tianyich-msft
Community Support
Community Support

Hi @sizi ,

 

If you want to use measure, try it:

Measure = var _t = ADDCOLUMNS('Table',"Rank",RANKX(ALL('Table'),'Table'[Avg(Task+SLA)],,ASC,Dense))
RETURN MAXX(_t,[Rank])

 

vtianyichmsft_0-1705973386496.png

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

all the 3 columns are measures defined fyi.

It showing 1 for all the employees.

sizi_0-1705981974317.png

 

@sizi 

Use this measure:

Rank BA Avg = 
IF(
    ISINSCOPE( Table35[Employee]),
    RANKX( 
        ADDCOLUMNS( ALL(Table35) , "Avg" , [BA Avg] ),
        [BA Avg],,
        ASC,
        Dense
    )
)

 

Fowmy_0-1705988124922.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Fowmy
Super User
Super User

@sizi 

Create a caluclated Column:

Rank = RANKX( SUMMARIZE(ALL(Table),Table[Employee],Table[Avg(Task+SLA)]) ,Table[Avg(Task+SLA)] ,,ASC,Dense)





Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Avg column is a measure. The above dax is giving error because of that.

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.