Forum Discussion

gaznez's avatar
gaznez
Resolver I
2 years ago
Solved

Dynamic ranking

Hi all,   I have a matrix with dates as the rows, branch as the columns, and then sales volumes and a rank as the values. The measure for my rank is:   RankVolOM = RANKX(ALL(Dates[Date]), [Total...
  • gaznez's avatar
    2 years ago

    UPDATE: I managed to figure this out if anyone is interested (with the help of ChatGPT)
    The following formula works (I'm not sure why/how)

    RankVolOM = VAR AllSelectedDates = CALCULATETABLE(
        VALUES(Dates[Date]),
        ALLSELECTED(Dates)
    )
    RETURN
    RANKX(
        AllSelectedDates,
        [TotalVolOM],
        ,
        DESC,
        Dense)