Forum Discussion
nanma94
6 years agoHelper III
Opportunity stage duration
I have an opportunity header table, that stores the latest stage, and I will ultimately want to analyze opportunity cycle time (duration per stage) by owner, territory. OpportunityId StageNa...
- 6 years ago
nanma94 try measure below and here is the result.
Days between Stages = VAR __oppyId = SELECTEDVALUE ( Oppy[OpportunityId] ) VAR __Stage = MAX ( 'Oppy Detail'[Stage #] ) VAR __StageDate = MAX ( 'Oppy Detail'[CreatedDate] ) VAR __prevStage = MAX ( __Stage - 1, 1 ) VAR __prevStageDate = CALCULATE ( MAX ( 'Oppy Detail'[CreatedDate] ), ALL ( 'Oppy Detail' ), Oppy[OpportunityId] = __OppyId, 'Oppy Detail'[Stage #] = __prevStage ) RETURN DATEDIFF( __prevStageDate, __StageDate, DAY )Would appreciate Kudos 🙂 if my solution helped.
parry2k
4 years agoSuper User
Cortana I'm also confused what you are referring too, if you can provide more details how you get to 11 days, it would help.
Cortana
4 years agoHelper IV
Look at the created date of stage 4. The opportunity entered stage 4 on 20th March and It entered stage 5 on 31st March. So this opportunity stays 11 days in stage 4, right?