Forum Discussion
nmeliasp
7 years agoRegular Visitor
datediff calculating milestone completion cycle time
Hello i have the following data and trying to calculate date difference in days between 2 different milestone completions Identifer Milestone Completion Completion date A X 1/1/2018 ...
- 7 years ago
Hi nmeliasp
You may use ALLEXCEPT Function as below:
Measure = VAR MAX_Date = CALCULATE ( MAX ( Table1[Completion date] ), ALLEXCEPT(Table1,Table1[Identifer]) ) VAR MIN_Date = CALCULATE ( MIN( Table1[Completion date] ), ALLEXCEPT(Table1,Table1[Identifer]) ) RETURN DATEDIFF ( MIN_Date,MAX_Date, DAY )Regards,
Cherie
Zubair_Muhammad
7 years agoCommunity Champion
Try this MEASURE..Drag Identifier and this MEASURE in a Table Visual
Measure =
VAR MilestoneY =
CALCULATE (
MAX ( Table1[Completion date] ),
Table1[Milestone Completion] = "Y"
)
VAR MilestoneX =
CALCULATE (
MAX ( Table1[Completion date] ),
Table1[Milestone Completion] = "X"
)
RETURN
DATEDIFF ( MilestoneX, MilestoneY, DAY )
nmeliasp
7 years agoRegular Visitor
This doesnt seem to have worked. I dont see anything for this measure.
- v-cherch-msft7 years agoMicrosoft Employee
Hi nmeliasp
You may use ALLEXCEPT Function as below:
Measure = VAR MAX_Date = CALCULATE ( MAX ( Table1[Completion date] ), ALLEXCEPT(Table1,Table1[Identifer]) ) VAR MIN_Date = CALCULATE ( MIN( Table1[Completion date] ), ALLEXCEPT(Table1,Table1[Identifer]) ) RETURN DATEDIFF ( MIN_Date,MAX_Date, DAY )Regards,
Cherie
- nmeliasp7 years agoRegular Visitor
Awesome that worked!!!