Forum Discussion
DR2022
3 years agoHelper I
Grouping by ID and making difference between dates
Hi! I need help with a function. How can I get the difference between the previous FinishDate and the StartDate and after group by ID from the data table below? It can be in M or DAX. The result wo...
- Anonymous3 years ago
Sorry allexcept does not work on this dax code
sue this instead
compareDate =VAR startdate = Standby[Start Date]var searchid = Standby[ID]VAR maxfinishdate =CALCULATE (MAX ( Standby[End Date] ),FILTER ( ALL ( Standby ), Standby[End Date] < startdate&&Standby[ID]=searchid))VAR result =DATEDIFF ( startdate, maxfinishdate , DAY )RETURNresult
Anonymous
3 years agoNot applicable
compareDate =
VAR startdate = Standby[Start Date]
VAR maxfinishdate =
CALCULATE (
MAX ( Standby[FinishDate] ),
FILTER ( ALL ( Standby ), Standby[finishDate] < startdate,allexcept(Stanby,Stanby[ID])
)
VAR result =
DATEDIFF ( startdate, maxfinishdate , DAY )
RETURN
result
- Anonymous3 years agoNot applicable
Sorry allexcept does not work on this dax code
sue this instead
compareDate =VAR startdate = Standby[Start Date]var searchid = Standby[ID]VAR maxfinishdate =CALCULATE (MAX ( Standby[End Date] ),FILTER ( ALL ( Standby ), Standby[End Date] < startdate&&Standby[ID]=searchid))VAR result =DATEDIFF ( startdate, maxfinishdate , DAY )RETURNresult