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

View all the Fabric Data Days sessions on demand. View schedule

Reply
oorf
Frequent Visitor

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]))
    )
)
 
oorf_0-1678296245033.png

 

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

 

oorf_1-1678296497771.png

 

 

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

 

oorf_2-1678296598567.png

 

 

1 REPLY 1
powerbi2srm
Resolver II
Resolver II

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.

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors