Forum Discussion
Conditional column - rows condition for Time comparision
- Anonymous2 years ago
Thanks for the reply from Ashish_Mathur and Greg_Deckler , please allow me to provide another insight:
Hi Anonymous ,Here are the steps you can follow:
1. Create calculated column.
Rank = RANKX( FILTER(ALL('Table'), 'Table'[Driver]=EARLIER('Table'[Driver])),[Time],,ASC)Mod = MOD([Rank],2)Group = SUMX( FILTER(ALL('Table'), 'Table'[Driver]=EARLIER('Table'[Driver])&&'Table'[Rank]<=EARLIER('Table'[Rank])),[Mod])Match = var _match_entrytime= MAXX( FILTER(ALL('Table'), 'Table'[Driver]=EARLIER('Table'[Driver])&&'Table'[Group]=EARLIER('Table'[Group])&&'Table'[Rank]=EARLIER('Table'[Rank])+1),[Time]) return IF( _match_entrytime>=[Time] || _match_entrytime=BLANK(),TRUE(),FALSE())2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Greg_Deckler Sorry for the confusion and not being clear. Below is my Sample text data. I have entry and exit for each truck with the time stamp. I want to match the first entry with the first exit and then subsequent entry and exit for each vehicle. The source file is getting updated with time stamps and some of the trucks don't have the exit time stamps till it data source gets updated.
| Type | Location | Truck | Driver | Time |
| Exit | Moncton MOC | KBS 1920-19 | Gourav Singh | 8:24:30 AM |
| Entry | Moncton MOC | KBS 1920-19 | Gourav Singh | 9:34:17 AM |
| Exit | Moncton MOC | KBS 1920-19 | Gourav Singh | 10:42:56 AM |
| Entry | Moncton MOC | KBS 1920-19 | Gourav Singh | 11:56:50 AM |
| Exit | Moncton MOC | KBS 1920-19 | Gourav Singh | 12:14:55 PM |
| Exit | Moncton MOC | KBS 2022-20 | Renan Felippe | 7:17:14 AM |
| Exit | Moncton MOC | KBS 2025-20 | iurii savonik | 8:26:34 AM |
| Entry | Moncton MOC | KBS 2025-20 | iurii savonik | 9:55:28 AM |
| Exit | Moncton MOC | KBS 2025-20 | iurii savonik | 10:33:46 AM |
| Entry | Moncton MOC | KBS 2025-20 | iurii savonik | 11:42:20 AM |
| Exit | Moncton MOC | KBS 2025-20 | iurii savonik | 12:15:41 PM |
Hi,
In another column, please show the expected result.