Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Ranking based on condition

Is it possible to rank based on conditions? For example I have list of tickets with Assigned to. If Assigned to is not blank only then the Rank should be assigned based on Ticketnumber (string).

 

TicketNumberAssigned ToRank
ABC1Joe1
BCD2John2
CDE3  
DEF4Stacy3
EFG5  
  • Hi Anonymous,

     

    Please create a calculated column using below formula:

    Rank =
    IF (
        Table1[Assigned To] = BLANK (),
        BLANK (),
        RANKX (
            FILTER ( Table1, Table1[Assigned To] <> BLANK () ),
            VALUE ( RIGHT ( Table1[TicketNumber], 1 ) ),
            ,
            ASC,
            DENSE
        )
    )

    Best regards,
    Yuliana Gu

3 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    Hi Shanka,

     

    Try this

    =If(ISBLANK(Table1[Assigned To]),

    BLANK(),

    calculate(COUNTrows(Table1),

    filter(Table1,Table1[TicketNumber]<=earlier(Table1[TicketNumber])&&NOT(ISBLANK(Table1[Assigned To])))

    )

    )

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi Anonymous,

     

    Please create a calculated column using below formula:

    Rank =
    IF (
        Table1[Assigned To] = BLANK (),
        BLANK (),
        RANKX (
            FILTER ( Table1, Table1[Assigned To] <> BLANK () ),
            VALUE ( RIGHT ( Table1[TicketNumber], 1 ) ),
            ,
            ASC,
            DENSE
        )
    )

    Best regards,
    Yuliana Gu