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 / Gallery filter not wor...
Power Apps
Unanswered

Gallery filter not working properly ( 3 options to choose from)

(0) ShareShare
ReportReport
Posted on by 17

Hi Everyone,

My app has a gallery and I am trying to setup a filter, so users can select 2 options to filter from. Meaning that they can select a code from a dropdown and a range of date.

Option 1  dropdown 

Option 2 Start date 

Option 2 End date

 

I have the following code setup to do the filter: 

If(Dropdown1.Selected.Value = "All", PAN2, Filter(PAN2, 'Pay Group' = Dropdown1.Selected.Value, 'Effective Date' >= DatePicker1.SelectedDate && 'Effective Date' <= DatePicker2.SelectedDate)) 

 

The issue is that when All is selected from the dropdown and the two DatePickers is selected it doesn't seem to be working. what I am missing here?

 

Thanks for your help,

 

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @esantos01 Are you getting any error or is it just not showing any data?

  • esantos01 Profile Picture
    17 on at

    @CNT  No errors. It just does not filter the gallery. 

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @esantos01 Try this,

    Filter(PAN2,
    	Switch(Dropdown1.Selected.Value,
    		"All", true,
    		"Pay Group",
    		If('Effective Date' >= DatePicker1.SelectedDate && 'Effective Date' <= DatePicker2.SelectedDate, true, false)
    	)
    )
  • esantos01 Profile Picture
    17 on at

    thanks the reply. I didn't work. 

  • Verified answer
    rizkyaditya Profile Picture
    292 on at

    Hello @esantos01 ,

     

    You can also try this :

    Filter(PAN2, 
    Dropdown1.Selected.Value = "All" Or 'Pay Group' = Dropdown1.Selected.Value ,
    'Effective Date' >= DatePicker1.SelectedDate And 'Effective Date' <= DatePicker2.SelectedDate)

     

    I hope this helps!

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @esantos01 What results are you getting?

  • esantos01 Profile Picture
    17 on at

    If the dropdown has all selected it does not filter by the datepicker only and if the dropdown has something other than all selected the gallery doesn't display anything.

  • esantos01 Profile Picture
    17 on at

    @CNT the code below worked like a charm. Thanks for your help!

     Filter(PAN2,
    Dropdown1.Selected.Value = "All" Or 'Pay Group' = Dropdown1.Selected.Value ,
    'Effective Date' >= DatePicker1.SelectedDate And 'Effective Date' <= DatePicker2.SelectedDate)

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard