Forum Discussion
Rank based on datetime
- 5 years ago
Anonymous try this measure
Rank = VAR __countFlag = CALCULATE ( COUNTROWS ( 'Rank' ), ALLEXCEPT ( 'Rank', 'Rank'[AgentID], 'Rank'[DateTime] ) ) VAR __rank = RANKX ( ALLEXCEPT ( 'Rank', 'Rank'[AgentID] ), CALCULATE ( MIN ( 'Rank'[DateTime] ) ), , DESC, DENSE ) RETURN IF ( __countFlag > 1 && MAX ( 'Rank'[AgentStatus] ) = "On Call", 0, __rank - IF ( __countFlag = 1, 1, 0 ) )Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Anonymous try this measure
Rank =
VAR __countFlag =
CALCULATE (
COUNTROWS ( 'Rank' ),
ALLEXCEPT ( 'Rank', 'Rank'[AgentID], 'Rank'[DateTime] )
)
VAR __rank =
RANKX (
ALLEXCEPT ( 'Rank', 'Rank'[AgentID] ),
CALCULATE ( MIN ( 'Rank'[DateTime] ) ), ,
DESC, DENSE
)
RETURN
IF (
__countFlag > 1 && MAX ( 'Rank'[AgentStatus] ) = "On Call", 0,
__rank - IF ( __countFlag = 1, 1, 0 )
)
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- Anonymous5 years agoNot applicable
Thanks Parry
It worked!