Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Ranking based on date and status

Hi All,    I have data that looks like  Name Status datetime(UTC) A 1 2020/01/05 17:59:57 A 2 2020/01/05 17:59:52 A 2 2020/01/05 17:59:51 A 3 2020/01/05 17:59:50 B 2 ...
  • v-yuta-msft's avatar
    6 years ago

    Anonymous ,

     

    Create a measure using dax below:

    Rank = 
    RANKX (
        FILTER (
            ALL ( 'Table' ),
            COUNTROWS ( FILTER ( 'Table', 'Table'[Status] = EARLIER ( 'Table'[Status] ) ) )
        ),
        CALCULATE ( ( SUM ( 'Table'[datetime(UTC)] ) ) ),
        ,
        DESC,
        DENSE
    )

     

     

    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.