Forum Discussion

Everton's avatar
Everton
Icon for Helper I rankHelper I
3 years ago
Solved

Rank within group

Hi, I want to rank within a group. First group by Id then rank by MostRecentUpdate. This is how I want the data to look.  Id InvoiceNumber InvoiceDate InvoiceStatus Owing MostRecentUp...
  • tamerj1's avatar
    tamerj1
    3 years ago

    Everton 
    You mean like this?

    RankInGroupTest = 
    IF (
        NOT ISEMPTY ( data ),
        RANKX ( 
            CALCULATETABLE ( 
                data,
                ALLEXCEPT ( Data, data[ID] )
            ),
            CALCULATE ( SELECTEDVALUE ( data[MostRecentUpdate] ) ),, 
            DESC, 
            Dense
        )
    )