cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SteveBouten
Frequent Visitor

Color fill time slots - booking schedule

Good afternoon all,

 

I'm trying to create an availability screen for our car bookings (see attached) based on the start date/time & end date/time.

All the booking info is available in a SharePoint list (see attached)

 

Test booking: 07/04/2021 10:00 - 08/04/2021 11:30 // Duration is 1530 minutes.

The lookup searches the list for the Start Date, Allocated vehicle (VBE08) & Start Time and then gives the "DurationMin" column value in the corresponding label.

 

I'd like it to color all the labels from the start date/time until the end date/time, including the next date when it's a long booking.

 

This formula is currently in the fill for 10:30: If(lblAsset1_6-30>=0,Red, lblAsset1_7-30>=0,Red,Transparent)

lblAsset1_6 = label next to 10:00

lblAsset1_7 = label next to 10:30

 

Any help would be much appreciated.

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @SteveBouten :

Do you want to get something like this?

32.gif

I've made a test for your reference:
1\My data source (SteveBoutenList)

Column (click to edit) Type
Title Single line of text
StartDate Date and Time(Date Only)
StartTime Single line of text
EndDate Date and Time(Date Only)
EndTime Single line of text

1.PNG

2\Add a date picker control(DatePicker1)

3\Add a gallery and set it's items property to

ForAll(
    Sequence(21,0,1),
    DateAdd(
        DatePicker1.SelectedDate + Time(7,30,0),
        30 * Value,
        Minutes
    )
)

4\Add a label control in to the gallery

Text

Text(ThisItem.Value,"[$-en]HH:mm")

BorderThickness

1

 5\Add an other label control control in to the gallery

Fill

With(
    {
        TheTable: Filter(SteveBoutenList,Title = "VBE08")
    },
    If(
        CountRows(
            Filter(
                TheTable,
                ThisItem.Value >= DateTimeValue(Text(StartDate,"[$-en]yyyy/mm/dd") & " " & StartTime) && 
                ThisItem.Value <= DateTimeValue(Text(EndDate,"[$-en]yyyy/mm/dd") & " " & EndTime))
        ) > 0,
        Red,
        RGBA(0,0,0,0)
    )
)

BorderThickness

 

1

 

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @SteveBouten :

Do you want to get something like this?

32.gif

I've made a test for your reference:
1\My data source (SteveBoutenList)

Column (click to edit) Type
Title Single line of text
StartDate Date and Time(Date Only)
StartTime Single line of text
EndDate Date and Time(Date Only)
EndTime Single line of text

1.PNG

2\Add a date picker control(DatePicker1)

3\Add a gallery and set it's items property to

ForAll(
    Sequence(21,0,1),
    DateAdd(
        DatePicker1.SelectedDate + Time(7,30,0),
        30 * Value,
        Minutes
    )
)

4\Add a label control in to the gallery

Text

Text(ThisItem.Value,"[$-en]HH:mm")

BorderThickness

1

 5\Add an other label control control in to the gallery

Fill

With(
    {
        TheTable: Filter(SteveBoutenList,Title = "VBE08")
    },
    If(
        CountRows(
            Filter(
                TheTable,
                ThisItem.Value >= DateTimeValue(Text(StartDate,"[$-en]yyyy/mm/dd") & " " & StartTime) && 
                ThisItem.Value <= DateTimeValue(Text(EndDate,"[$-en]yyyy/mm/dd") & " " & EndTime))
        ) > 0,
        Red,
        RGBA(0,0,0,0)
    )
)

BorderThickness

 

1

 

Best Regards,

Bof

View solution in original post

Hi Bof,

 

That's exactly what I was looking for. Thank you so much!!

 

Kind regards,

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,397)