Forum Discussion
AlexPayette
3 years agoFrequent Visitor
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...
- 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] ) )
johnt75
Super User
3 years agoRank =
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] )
)AlexPayette
3 years agoFrequent Visitor
It worked, thanks !