Forum Discussion

lheilig's avatar
lheilig
New Member
4 years ago
Solved

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...
  • Anonymous's avatar
    Anonymous
    4 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