Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Another 'filter' question.

(1) ShareShare
ReportReport
Posted on by 63

I have seen plenty of questions and answers, re: filtering between two dates but none specific to my issue.

 

I am filtering a gallery were the clocked time was between to date pickers. My code is:

Filter(Employment_Time, 'Time IN' >= DatePicker_Start.SelectedDate && 'Time IN' <=DatePicker_End.SelectedDate)
 
The results are strange:
1. dates set to Jan 01 2024 - Jan 02 2024 = only records on Jan 01
2. dates set to Jan 01 2024 - Jan 03 2024 = records for Jan 01 AND Jan 02
 
I assume that <= should include all dates before and ON the date chosen. Where am I wrong?
 
Thanks in advance.
Categories:
  • JoelL Profile Picture
    63 on at
    Another 'filter' question.
    In case anyone else struggles with this, I was able to make it work (with the help of the folks at PowerApps911, by wrapping it in datevalue and text.
     
    Original code :
     
    Filter(Employment_Time, 'Time IN' >= DatePicker_Start.SelectedDate && 'Time IN' <=DatePicker_End.SelectedDate)
     
    Becomes:
    Filter(Employment_Time,'Time IN'>= (DatePicker_Start.SelectedDate) && DateValue(Text('Time IN',DateTimeFormat.ShortDate)) <= (DateValue(Text(DatePicker_End.SelectedDate,DateTimeFormat.ShortDate))))
  • JoelL Profile Picture
    63 on at
    Re: Another 'filter' question.

    Thank you but with your addition, on my end, it's the same. If want to include the 2nd, I must set the end date to the 3rd.

  • SpongYe Profile Picture
    5,580 Super User 2025 Season 1 on at
    Re: Another 'filter' question.

    Hi @JoelL 

     

    Try this just as a workaround:

     

     

    Filter(
     Employment_Time, 
     'Time IN' >= DatePicker_Start.SelectedDate && 
     'Time IN' < DateAdd(DatePicker_End.SelectedDate, 1, Days)
    )

     

    I believe this had to do with the date format a topic that already got tackled on the forum:https://powerusers.microsoft.com/t5/Building-Power-Apps/Filtering-a-Gallery-using-two-date-fields-from-a-SharePoint-list/td-p/514726

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1