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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering with DatePicker
Power Apps
Answered

Filtering with DatePicker

(0) ShareShare
ReportReport
Posted on by 6

Hello -

 

I am looking to filter my gallery by using the datepicker. Here is what I have... the filter for campus dropdown works perfectly but the date picker will not filter correctly. Can someone help? Thank you!

 

Filter(Table1,
If('Campus Dropdown'.Selected.Value='Campus',Campus='Campus Dropdown'.Selected.Value),
If(DatePicker1.SelectedDate=Today(),DateEntered=DatePicker1.SelectedDate,""))

Categories:
  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    Hi @arc012 ,

    Without looking at the logic of the rest of your code - the date filter should work as below.

    Filter(
     Table1,
     If(
     'Campus Dropdown'.Selected.Value='Campus',
     Campus='Campus Dropdown'.Selected.Value
     ) &&
     If(
     IsToday(DatePicker1.SelectedDate),
     IsToday(DateEntered)
     )
    )

    I am assuming you want no results unless these two tests are true.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@arc012,

    Based on the issue you mentioned, you want to filter the gallery based on the DatePicker selected date.

    Could you please share more about your data source, is it a SP list or an Excel sheet?

    I have a test using a SP list and the formula you provided goes well.

    In an Excel sheet, a date column is Date and Time value, so you should format it when you make a filter.

    I have a test on my side, please take a try as below:

    0519.png

    Filter(
    
     Table1,
    
     If(
    
     Campus = "Harvard",
    
     "Harvard" = Campus
    
     ),
    
     If(
    
     DatePicker4.SelectedDate = Today(),
    
     Text(
    
     DateEntered,
    
     DateTimeFormat.ShortDate
    
     ) = Text(
    
     DatePicker4.SelectedDate,
    
     DateTimeFormat.ShortDate
    
     ),
    
     true
    
     )
    
    )
    

    Please provide some screenshots about the error and your data source.

     

    Best Regards,

    Qi Qiao

  • arc012 Profile Picture
    6 on at

    So, this seems to work if I'm on TODAY. If I go back in time and want to see everything that was entered say, yesterday, I get no results. Thoughts on making that work?

  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    @arc012 ,

    That was your original code - you wanted to test for Today(), so that is what it is filtering on.

    If you put a DatePicker on the screen, set the Default for Today(), but you can change it (I will call it dpSearch below - call it whatever your want to)

    Filter(
     Table1,
     If(
     'Campus Dropdown'.Selected.Value='Campus',
     Campus='Campus Dropdown'.Selected.Value
     ) &&
     If(
     DateDiff(
     dpSearch,
     DatePicker1.SelectedDate,
     Days
     )=0,
     DateDiff(
     dpSearch, 
     DateEntered,
     Days
     )=0
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@arc012,

    Do you want to filter the gallery by the selected date rather than default Today()?

    You need to do some fine-tuning with the original formula I provided as below:

    Filter(
     '051901',
     If(
     'Campus Dropdown'.Selected.Value = 'Campus’,
     'Campus’ = 'Campus Dropdown'.Selected.Value
     ),
     Text(
     DateEntered,
     ShortDate
     ) = Text(
     DatePicker1.SelectedDate,
     ShortDate
     )
    )

    Now you can filter whenever you want.

     

    Best Regards,

    Qi Qiao

  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    @arc012 ,

    Both of these will work - just a different approach on syntax.

  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    Hi @arc012 

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard