Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Create a rank/index using created date against ID

I have a table where I have multiple TSID's with the same value due to adjustments being made to the original TSID which brings in additional transaction lines. I would like to identify the origin...
  • danextian's avatar
    danextian
    4 years ago

    Hi Anonymous ,

     

    Try this:

    Rank =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Date] <= EARLIER ( 'Table'[Date] )
                && 'Table'[ID] = EARLIER ( 'Table'[ID] )
        )
    ) - 1
    //-1 to make the first one zero