Forum Discussion
lheilig
4 years agoNew Member
Calculating Time to Return Across Multiple Rows
Hi All! I've been using Power BI for a little while now, but my Google Fu is failing me on this one. I have a list of customers with Unique Ids and their Dates of Arrive and Departure. I can easi...
- Anonymous4 years ago
Hi lheilig ,
Please check the formula.
Column = var next_arrive = CALCULATE(MIN('Table'[Arrive]),FILTER(ALLEXCEPT('Table','Table'[ID]),'Table'[Depart]>EARLIER('Table'[Depart]))) return IF(ISBLANK(next_arrive),0,DATEDIFF('Table'[Depart],next_arrive,DAY))Best Regards,
Jay
Anonymous
4 years agoNot applicable
Hi lheilig ,
Please check the formula.
Column =
var next_arrive = CALCULATE(MIN('Table'[Arrive]),FILTER(ALLEXCEPT('Table','Table'[ID]),'Table'[Depart]>EARLIER('Table'[Depart])))
return
IF(ISBLANK(next_arrive),0,DATEDIFF('Table'[Depart],next_arrive,DAY))
Best Regards,
Jay