Forum Discussion
Dynamic Row_Number
- 7 years ago
Anonymous ,
You need to create an addtional index and then create a measure using DAX below:
Row Number = COUNTROWS ( FILTER ( ALLSELECTED ( Employee ), COUNTROWS ( FILTER ( Employee, Employee[Total Marks] <= EARLIER ( Employee[Total Marks] ) && Employee[Index] >= EARLIER ( Employee[Index] ) ) ) ) )Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It's exactly the same as your RANKX function, just find some way to break ties and incorporate that in it - maybe just add an index and use that
- Anonymous7 years agoNot applicable
- v-yuta-msft7 years ago
Community Support
Anonymous ,
You need to create an addtional index and then create a measure using DAX below:
Row Number = COUNTROWS ( FILTER ( ALLSELECTED ( Employee ), COUNTROWS ( FILTER ( Employee, Employee[Total Marks] <= EARLIER ( Employee[Total Marks] ) && Employee[Index] >= EARLIER ( Employee[Index] ) ) ) ) )Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous7 years agoNot applicable
Hi v-yuta-msft
Thanks for your solution. This is great! But the thing is it is working for the pre-calculated ranks. But as per your screenshots, you selected 2019 and we have 4 students listed with rank and row numbers which is correct. In my scenario, out of those 4 students, Mohan is in row 2 and rank 2. Mohan may also present in rank 1 and row 1 when we select 2018.
In this dynamic scenario, it is not working because the row number is calculating based on the predefined Index values.