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 / Power Apps Gallery Dat...
Power Apps
Answered

Power Apps Gallery Date Filter overrides all other filters

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a gallery with several different filters to include a date range, radio buttons from SP choice columns, and a drop down from a choice column as well.  Separately the date filter works fine and does what it is supposed to do.  In addition, I can select all of the radio and drop-down filters to drill down on my gallery and it works fine.  The issue is that when I use the date range filter, it will override any other filters that I have selected.  My goal was to be able to drill down not only by date, but even further with the other filters.  Below is the current formula I have for my gallery.  Am I missing something or is the date filter only able to operate independently of the others?  Any help is appreciated. 

 

With({_items:SortByColumns(Filter('SP List Name',(('Start Date' >= EngStart.SelectedDate && 'Start Date' <= EngEnd.SelectedDate) || (EngStart.SelectedDate = Blank() && EngEnd.SelectedDate = Blank()) && ('Engagement Status'.Value = EngStatusRadio.Selected.Value ||EngStatusRadio.Selected.Value = Blank()) && ('Senior Engagement'.Value = EngSeniorRadio.Selected.Value || EngSeniorRadio.Selected.Value = Blank()) && ('Industry Sector'.Value = SectorDropDown.Selected.Value || SectorDropDown.Selected.Value = Blank()))),"StartDate",SortOrder.Descending)},Switch(vartabselected,1,_items))

Categories:
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Anonymous,

     

    The code is missing an extra starting and closing bracket around the date filter. The current code says Or filter via date Or if date is blank, use all other filters.

     

    Filter('SP List Name',(('Start Date' >= EngStart.SelectedDate && 'Start Date' <= EngEnd.SelectedDate) || (EngStart.SelectedDate = Blank() && EngEnd.SelectedDate = Blank()) && ...The other filters ...)

     

    What you could do is add additional brackets (red brackets below):

    Filter('SP List Name',((('Start Date' >= EngStart.SelectedDate && 'Start Date' <= EngEnd.SelectedDate) || (EngStart.SelectedDate = Blank() && EngEnd.SelectedDate = Blank())) && ...The other filters ...)

     

    However, you could also leave out the && operators and use commas instead. This will increase the readability of your filter conditions drastically:

     

    With(
     {
     _items:SortByColumns(
     Filter(
     'SP List Name',
     ('Start Date' >= EngStart.SelectedDate && 'Start Date' <= EngEnd.SelectedDate) || (EngStart.SelectedDate = Blank() && EngEnd.SelectedDate = Blank()), 
     'Engagement Status'.Value = EngStatusRadio.Selected.Value ||EngStatusRadio.Selected.Value = Blank(), 
     'Senior Engagement'.Value = EngSeniorRadio.Selected.Value || EngSeniorRadio.Selected.Value = Blank(),
     'Industry Sector'.Value = SectorDropDown.Selected.Value || SectorDropDown.Selected.Value = Blank()
     ),
     "StartDate",
     SortOrder.Descending
     )
     },
     Switch(vartabselected,1,_items)
    )

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @LaurensM, that works absolutely perfectly.  I would have never thought of the commas in this instance.  Thank you very much.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard