I want to return the last (Max) event datetime which I can do using the following set analysis
Max({$<[Event Type Id]={'New'}>}[Event Time])
But if this datetime is after the "end datetime" I want the last event datetime within the range between Start - End Datetime. See below example data. As you can see the "Max Event time" is after "End Datetime". Therefore I'd like to return the last event time between the start and end times.
ID
Start DateTime
End Datetime
Min Event Time
Max Event Time
111111
11/10/2022 14:01
11/10/2022 20:00
11/10/2022 14:40
04/11/2022 15:46
I hope this makes sense. Any help would be greatly appreciated.