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 / Filter only working wi...
Power Apps
Unanswered

Filter only working with early values when an If statement is embedded

(0) ShareShare
ReportReport
Posted on by 2

So I'm trying to filter the items in a gallery but for some reason the early entries only show up when I have an If statement in it?

 

Filter(
 DESK_BOOKINGS,
 BookingDate = DatePicker1.SelectedDate
)

 

doesn't return early entries but

 

Filter(
 DESK_BOOKINGS,
 If(
 IsBlank(DatePicker1) = false,
 BookingDate = DatePicker1.SelectedDate,
 BookingDate = DatePicker1.SelectedDate
 )
)

 

this code does. it's the same whether the If statement goes through the true or else statements

 

Ultimately I'm going to use a collection instead of pulling direct from the sharepoint list which shouldn't have this issue but I'm just very confused why the second code works while the first doesn't when they basically do the same thing

Categories:
I have the same question (0)
  • SebS Profile Picture
    4,867 Super User 2026 Season 2 on at

    HI @esutherland 

     

    try to use:

     

     

    Filter(
     DESK_BOOKINGS,
     IsBlank(DatePicker1.SelectedDate) || IsEmpty(DatePicker1.SelectedDate) || 
     BookingDate = DatePicker1.SelectedDate
    )

     

     

    That will help manage Blank or Empty state of picker and show all records if there is nothing Picked also 

    keep in mind Date picker as Default is set up to Today() means if you don't have any records with Today date there is nothing to show.

     

    To change this, go to Properties and change Default property of Date Picker replace Today() with IsBlank()

     

    You can change this to IsBlank() means as default there is nothing picked in the Date picker what should help to show all records

  • esutherland Profile Picture
    2 on at

    Nah that code still doesn't include the early entries when I try it, I think you've misunderstood the issue: the datepicker is irrelevant, I'm just pulling a list of values from that date and the datepicker aspect of it works perfectly fine even if it's set to default. It's just that the filter is excluding early entries from my list with the same date (shows ID 240 on 8/12 but not ID 135 on 8/12). For some reason it's fixed when I add an If statement. I have no idea why

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
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard