Forum Discussion

oorf's avatar
oorf
Frequent Visitor
3 years ago

Ranking on bar graph

Hello,

 

I have used the following Dax formula to create a measure that ranks my top Client Groups by Fail Count per Location

 

Rank Client Fail Group = IF (
    ISINSCOPE'Fail List'[Client Groups] ),
    RANKX (
        CALCULATETABLE (
            VALUES ( 'Fail List'[Client Groups] ),
            ALLSELECTED ( 'Fail List'[Client Groups] )
        ),
       CALCULATESUM('Fail List'[Fail Count]))
    )
)
 

 

I am trying to translate this into a bar graph so that my y axis has my groups, and the x axis has the count of locations in which it is the top fail similar to this

 

 

 

How can this be done in power bi? Currently it is displaying all 8 locations as having headliner as the top fail.

 

 

 

1 Reply

  • Firstly, create a measure with number of fails: SUM('Fail List'[Fail Count]'). Then try with somenthing like this:

     

     

    Top 10 client groups by fail count = 
    
    VAR rank_client_group = 
    RANKX(
        ALL('Fail list'[Client Groups]),
        [num_fails],
        [num_fails],
        DESC,
        Dense
    )
    
    VAR top10_rank=
    IF(
        rank_client_group<=10,
        [num_fails],
        BLANK()
    )
    
    RETURN top10_rank

     

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