web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Another 'filter' quest...
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:
I have the same question (0)
  • SpongYe Profile Picture
    5,603 Super User 2025 Season 2 on at

    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! 🍻

  • JoelL Profile Picture
    63 on at

    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.

  • JoelL Profile Picture
    63 on at
    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))))

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard