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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
archana_c
Helper I
Helper I

Give same rank to same group.

I have a table visual with the following columns, participant name(group), allocation no, outstanding balance. I need to rank the participant name(group) based on outstanding balance (desc order), but the same rank to be given to the same participant name. for example, if the participant A has two allocation no, then both the rows should be ranked as 1(or same rank).

dummy.png
@amitchandak 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @archana_c ,

You can create a measure as below to get it, please find the details in the attachment.

rank = 
RANKX (
    ALLSELECTED ( 'Table'[participant name] ),
    CALCULATE (
        MAX ( 'Table'[outstanding balance] ),
        ALLEXCEPT ( 'Table', 'Table'[participant name] )
    ),
    ,
    DESC,
    DENSE
)

vyiruanmsft_0-1698825720284.png

Best Regards

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

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @archana_c ,

You can create a measure as below to get it, please find the details in the attachment.

rank = 
RANKX (
    ALLSELECTED ( 'Table'[participant name] ),
    CALCULATE (
        MAX ( 'Table'[outstanding balance] ),
        ALLEXCEPT ( 'Table', 'Table'[participant name] )
    ),
    ,
    DESC,
    DENSE
)

vyiruanmsft_0-1698825720284.png

Best Regards

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

Thank you for the solution. Its working fine.
Is it possible to remove rows with 0 values if there are no negative values,(need to keep the rows with 0 if there are negative values) Because i am using this measure inorder to get the top 5 list(as well as bottom 5). But if there are more than one participant with 0 value, its ranked the same and if the rank is below 5 then all are listed. Let me know if any condition can be added in the dax. 
Thank you

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.