Forum Discussion

AlexPayette's avatar
AlexPayette
Frequent Visitor
3 years ago
Solved

Rankx function showing all 1 in a calculated column

Hi,   I am trying to use the Rankx function to order my different shifts starting with 1 desc. I have a fact table which showcases my shifts everyday. There's two shifts, day shift (from 6h AM to 5...
  • johnt75's avatar
    3 years ago
    Rank = 
    var ReferenceDate = 'Table'[Shift End Date]
    return
    CALCULATE(
        RANKX( ALL('Table'), 'Table'[Shift End Date], ReferenceDate , DESC, Dense ),
        ALLEXCEPT('Table', 'Table'[Shift Start Date], 'Table'[Shift End Date] )
    )