Forum Discussion
Mafesa_Sasol
3 years agoFrequent Visitor
Finding the difference between two dates in different rows
Hi, I would really appreciate any assistance. I am trying to find the difference between the Start and End Date but in different rows and different columns. For example, in the attached data table, I...
- Anonymous3 years ago
Hi mafesa sasol,
Please find the code :
Standby Date =VAR enddate = Standby[End Date]VAR startdate = Standby[Start Date]VAR minstartdate =CALCULATE (MIN ( Standby[Start Date] ),FILTER ( ALL ( Standby ), Standby[Start Date] > startdate ))VAR result =DATEDIFF ( enddate, minstartdate, DAY )RETURNresult
Anonymous
3 years agoNot applicable
Hi mafesa sasol,
Please find the code :
Standby Date =
VAR enddate = Standby[End Date]
VAR startdate = Standby[Start Date]
VAR minstartdate =
CALCULATE (
MIN ( Standby[Start Date] ),
FILTER ( ALL ( Standby ), Standby[Start Date] > startdate )
)
VAR result =
DATEDIFF ( enddate, minstartdate, DAY )
RETURN
result
Anonymous2024
2 years agoRegular Visitor
Hi, Can you help with excluding weekends (& holidays if possible) in the above solution you have posted?? Thank you!