Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Finding the duration between dates in a row

Good afternoon,

 

I am currently struggeling with a dataset in which each row has an individual timeline, i need to calculate the amount of time the truck waits as indicated with waiting 1 and waiting 2 in each row as shown below.

Of course this is a rough draft quickly made in Excel, the real dataset simply has to many columns to calculate with the if function since in the full dataset there are also reasons for waiting. These reasons and events are not sorted either since different trucks have different structured timelines.

Is it possible in power BI to make a formula which calculates how long each truck waits by subtracting "Waiting 1" with the next chronological event?

Below is an example what i want:

 

3 Replies

  • Anonymous , Not very clear. Based on what I got a new column

     

    next arrival time = minx(filter(Table, [ID] = earlier([ID]) && [Arrival] > earlier([Arrival])),[Arrival])

     

    We basically need a arrival date time