Forum Discussion
Soof1234
3 years agoHelper I
Make continuous ranking if values are the same
Hi, Well known issue, but the related posts mostly contain solutions based on a column by adding an index. My problem however, is that I created the ranking based on a measure. I created a ran...
- 3 years ago
Hi,
Thank you for your message, and please check the below picture and the attached pbix file.
Rank: = VAR _table = ADDCOLUMNS ( ADDCOLUMNS ( ALL ( Intakes[Sourcers.Title] ), "@rankone", CALCULATE ( RANKX ( ALL ( Intakes[Sourcers.Title] ), [Intakes:],, DESC ) ), "@ranktwo", CALCULATE ( RANKX ( ALL ( Intakes[Sourcers.Title] ), CALCULATE ( MAX ( Intakes[Sourcers.Title] ) ), , ASC ) ) ), "@newindex", [@rankone] * 100 + [@ranktwo] ) VAR _newtable = ADDCOLUMNS ( _table, "@newrank", RANKX ( _table, [@newindex],, ASC ) ) RETURN IF ( HASONEVALUE ( Intakes[Sourcers.Title] ), MAXX ( FILTER ( _newtable, Intakes[Sourcers.Title] = MAX ( Intakes[Sourcers.Title] ) ), [@newrank] ) )
Jihwan_Kim
3 years agoSuper User
Hi,
Thank you for your message, and please check the below picture and the attached pbix file.
Rank: =
VAR _table =
ADDCOLUMNS (
ADDCOLUMNS (
ALL ( Intakes[Sourcers.Title] ),
"@rankone", CALCULATE ( RANKX ( ALL ( Intakes[Sourcers.Title] ), [Intakes:],, DESC ) ),
"@ranktwo",
CALCULATE (
RANKX (
ALL ( Intakes[Sourcers.Title] ),
CALCULATE ( MAX ( Intakes[Sourcers.Title] ) ),
,
ASC
)
)
),
"@newindex",
[@rankone] * 100 + [@ranktwo]
)
VAR _newtable =
ADDCOLUMNS ( _table, "@newrank", RANKX ( _table, [@newindex],, ASC ) )
RETURN
IF (
HASONEVALUE ( Intakes[Sourcers.Title] ),
MAXX (
FILTER ( _newtable, Intakes[Sourcers.Title] = MAX ( Intakes[Sourcers.Title] ) ),
[@newrank]
)
)
Soof1234
3 years agoHelper I
Thanks a lot! This works perfectly, also tested it with a lot of equal intakes! See below:
Kind Regards,
Soof1234