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
AlexanderBrueck
Regular Visitor

Rank values without duplicate ranking

Dear Community,

 

I tried to get the ranking displayed in column "Rank" by using Rankx - without success.

 

The idea is to rank the amounts in column "€" for each month. When there are duplicate values (e. g. 2.950 € in March) the first apperance should be 3 for instance and all following rankings for the the values should get the next higher number - in this case 4.

 

Is there any solution for this? Thanks in advance!

powerbi_rank.PNG

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@AlexanderBrueck 

 

We can take help from an Index column to manage duplicates

First add an index columm from Query Editor. Then this DAX calculated column

 

Rank Column =
RANKX (
    FILTER (
        Table1,
        Table1[date].[Month] = EARLIER ( Table1[date].[Month] )
            && Table1[date].[Year] = EARLIER ( Table1[date].[Year] )
    ),
    [Euro]
        - [Index] / POWER ( 10, 9 ),
    ,
    DESC,
    DENSE
)

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@AlexanderBrueck 

 

We can take help from an Index column to manage duplicates

First add an index columm from Query Editor. Then this DAX calculated column

 

Rank Column =
RANKX (
    FILTER (
        Table1,
        Table1[date].[Month] = EARLIER ( Table1[date].[Month] )
            && Table1[date].[Year] = EARLIER ( Table1[date].[Year] )
    ),
    [Euro]
        - [Index] / POWER ( 10, 9 ),
    ,
    DESC,
    DENSE
)

Regards
Zubair

Please try my custom visuals

Hello,
How to avoid duplication on a measure?
With your technique, "it is impossible to determine a unique value for the INDEX column".

Thanks

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.

Top Solution Authors