Forum Discussion
saranee
8 years agoHelper I
Dynamic ranking based on date
Hi all, Request your help on this. We are basically having a table with Name,Date and based on date we are assigning Rank. We have calculated column to calculate rank:RANKX(FILTER(Table1,Tab...
- 8 years ago
Try this MEASURE for dynamic RANKING
RANK = RANKX ( FILTER ( ALLSELECTED ( Table1 ), Table1[Name] = SELECTEDVALUE ( Table1[Name] ) ), CALCULATE ( SELECTEDVALUE ( Table1[Date] ) ), , DESC, DENSE )
ricardocamargos
8 years agoContinued Contributor
Hi saranee,
Try this code:
_Index =
IF(ISBLANK(CALCULATE(COUNTROWS(Table2); FILTER(ALLSELECTED(Table2[Date]); Table2[Date] < MAX(Table2[Date]))));
1;
CALCULATE(COUNTROWS(Table2); FILTER(ALLEXCEPT(Table2; Table2[Name]); Table2[Date] < MAX(Table2[Date]))) + 1)
Ricardo
Zubair_Muhammad
8 years agoCommunity Champion
Try this MEASURE for dynamic RANKING
RANK =
RANKX (
FILTER ( ALLSELECTED ( Table1 ), Table1[Name] = SELECTEDVALUE ( Table1[Name] ) ),
CALCULATE ( SELECTEDVALUE ( Table1[Date] ) ),
,
DESC,
DENSE
)- rishikdutta19878 years agoRegular Visitor
Zubair_Muhammad Thats the correct solution!!
- v-huizhn-msft8 years agoMicrosoft Employee
Hi rishikdutta1987,
Please mark the right solution as answer, so more people like you can find the solution easily.
Best Regards,
Angelia
- Anonymous7 years agoNot applicable
Zubair_Muhammad Thanks for the solution, it worked seamlessly.
- Anonymous4 years agoNot applicable
Kudos on this solution