Forum Discussion

Jeanxyz's avatar
Jeanxyz
Icon for Power Participant rankPower Participant
2 years ago
Solved

DAX rank in column

I have a table with multiple Issue_Keys, each issue_Key has multipel status records. I would like ot rank the status records based on [Created] field per Issue_Key. [Ranking expected] is what I expec...
  • bhanu_gautam's avatar
    2 years ago

    Jeanxyz , Use below DAX

     

    DAX
    Ranking =
    VAR CurrentIssueKey = 'Fact_Status Log'[ISSUE_KEY]
    VAR CurrentCreated = 'Fact_Status Log'[CREATED]
    RETURN
    CALCULATE(
    COUNTROWS(
    FILTER(
    'Fact_Status Log',
    'Fact_Status Log'[ISSUE_KEY] = CurrentIssueKey &&
    'Fact_Status Log'[CREATED] <= CurrentCreated
    )
    ),
    ALLEXCEPT('Fact_Status Log', 'Fact_Status Log'[ISSUE_KEY])
    )