Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Dynamic Row_Number

Hi, I have a requirement where I have employees and their marks by class and year as mentioned below. In the below example, Year is my slicer. Based on this slicers selection I have to rank the empl...
  • v-yuta-msft's avatar
    v-yuta-msft
    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.