Currently, in my Gallery, color of Desks are set (Gree/Red) according to their availability
- by checking against the Date selected by user with the Dates of active bookings ('Reservation Details')
Switch(
LookUp(
ForAll(
Filter(
'Reservation Details',
Date >= FromDate_Dp.SelectedDate,
Date <= ToDate_Dp.SelectedDate && 'Booking Status' = 'Booking Status (Reservation Details)'.Booked
),
{
DeskName: 'Reserved Desk'.Name,
BookingStatus: Text('Booking Status')
}
),
DeskName = ThisItem.Name
).BookingStatus,
"Booked",
Color.Red,
Color.Green
)
However, there is now 'Time' value implemented.
So instead of only filtering/checking via Date, I have to check Date + Time.

Below is the code I tried to modify to include Time, but the results are not correct.
(Booked Desks are still displayed as available in Green color)
Switch(
LookUp(
ForAll(
Filter(
'Reservation Details',
'Start Date Time' >= FromDate_Dp.SelectedDate + Time(Value(FromTimeHour_Ddl.Selected.Value), Value(FromTimeMinutes_Ddl.Selected.Value), 0),
'End Date Time' <= ToDate_Dp.SelectedDate + Time(Value(ToTimeHour_Ddl.Selected.Value), Value(ToTimeMinutes_Ddl.Selected.Value), 0) && 'Booking Status' = 'Booking Status (Reservation Details)'.Booked
),
{
DeskName: 'Reserved Desk'.Name,
BookingStatus: Text('Booking Status')
}
),
DeskName = ThisItem.Name
).BookingStatus,
"Booked",
Color.Red,
Color.Green
)
E.g.
- If a Desk is booked between 9am - 5pm in a day, the Desk should be not available (Red color) if any Date+Time is selected between that period
- If a Desk is booked between 12pm - 6pm across N days, the Desk should not be available (Red color) if any Date+Time is selected between that period
Any help is greatly appreciated.