Forum Discussion
Simplifying a code using the "earlier" function
- 4 years ago
Anonymous , Sorry, Try like
CALCULATE(MIN('Bridge Hall 3 M'[DateHour_Origin]),FILTER('bridge Hall 3 M','bridge Hall 3 M'[Number_bridge]=EARLIER('bridge Hall 3 M'[Number_Pont])
&&'bridge Hall 3 M'[Date Rank] = EARLIER('bridge Hall 3 M'[Date Rank]) +1 ))-'bridge Hall 3 M'[Datehour_Arrival])
I just passed but I don't get the right values...
An example of the application I need:
Deck 2 datetime departure: 20/07/22 01:06:23 dtatetime arrival: 20/07/22 01:07:23
Deck 3 datetime departure: 20/07/22 03:00:26 datetime arrival: 20/07/22 03:07:26
Deck 1 start time: 20/07/22 02:00:00 finish time: 20/07/22 02:04:05
Deck 2 datetime departure : 20/07/22 03:08:00 dtatetime arrival : 20/07/22 03:09:55
The code must take into account the bridge number, the departure time after 03:08:00 minus the arrival time before 01:07:23 = 2:00:37