Forum Discussion
Event duration
- 3 years ago
Using Power Query sort the table data by Escalation ID and Date Time ASC
Then create an Index column in Power Query (Add Column --> Index Column)
Finally create a new column with the following DAX formula:
Duration in Days = VAR Previous = MAXX(FILTER(Sheet1,Sheet1[Escalation ID]= (Sheet1[Escalation ID]) && Sheet1[Index]-1 =EARLIER(Sheet1[Index])),Sheet1[Date Time]) RETURN DATEDIFF(Sheet1[Date Time],Previous,HOUR) /24I have attached the PowerBI workspace
Hello,
You could use the datediff fucntion and specify the interval to day.
DATEDIFF(<Date1>, <Date2>, <Interval>)
like this DATEDIFF ( StartDate, EndDate, Day)
ypu can check this link for more info about datediff https://learn.microsoft.com/en-us/dax/datediff-function-dax
If I answered your question, please mark my post as solution so it would appeare to others, Appreciate your Kudo 👍
- gkakun3 years agoHelper III
Hi, Thanks! Yes, I familiar with this function and tried all kind of versions with it, but nothing worked as expcted so far