cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dennisb88
Resolver III
Resolver III

Filter gallery on date/time values

Hi all,

 

I'm try to filter my gallery based on time values:

My dataverse table has two date/time columns, called: Startdate & Enddate.

 

I'm filtering all the items in my gallery that has a starttime before 15.00 or between 15.00-16.00 & has an endtime later than 15.00.

That's working great when the item is started today and ended today.

But when the item is started earlier than today or/and has an enddate later then today it should also be inside the filter.

My current filter:

 

With(
    {_item: Appointments},
    Filter(
        _item,
        DateDiff(
            TimeValue(Text('Start Time')),
            TimeValue("4:00:00 PM"),
            Minutes
        ) > 0 && DateDiff(
            TimeValue(Text('End Time')),
            TimeValue("3:00:00 PM"),
            Minutes
        ) < 0
    )
)

 

 

In this filter works/works not the following:

StartTimeStartDateEndTimeEndDateShould be showed:Works
14:00Today16:00 (or later)TodayYesYes
15:00Today15:15 (or later)TodayYesYes
14:00Today15:00TomorrowYesNo
14:00Today15:00TodayNoYes
16:00Yesterday10:00TomorrowYesNo
16:00Yesterday16:00TodayYesNo

 

Does anyone know what I need to change in my filter?

I tried something with 'Or' greater than today function, but that's not working for some cases.

 

Hopefully someone knows how to extend my filter so it will match 

0 REPLIES 0

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,109)