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 / Applying multiple filt...
Power Apps
Answered

Applying multiple filters to a gallery using a combination of buttons & combo boxes...

(0) ShareShare
ReportReport
Posted on by 10

Hello, I've finally given up and decided I need help with this issue. This is my first attempt at building an app.

I am hoping to provide users with different filters they can use to filter the gallery. Currently I have six buttons, each of which has the following  sort of code for OnSelect - 

 

UpdateContext({varFilterBy:"Overdue"}) , UpdateContext({varFilterBy:"Completed"})

 

 



I then have the following code for Items in my Gallery, which works as intended:

 

If(
varFilterBy = "Completed",
Filter(
'Task Tracker (Testing)',
Completion = 100
),
If(
varFilterBy = "Outstanding",
Filter(
'Task Tracker (Testing)',
Completion < 100
),
If(
varFilterBy = "Overdue",
Filter(
'Task Tracker (Testing)',
And(
DueDate < Today(),
Completion < 100
)
),
If(
varFilterBy = "DueToday",
Filter(
'Task Tracker (Testing)',
And(
DueDate = Today(),
Completion < 100
)
),
If(
varFilterBy = "Upcoming",
Filter(
'Task Tracker (Testing)',
And(
DueDate >= varToday,
DueDate <= varOneWeekFromNow,
Completion < 100
)
),
If(
varFilterBy = "All",
'Task Tracker (Testing)'
))))))



However, I am struggling to add my ComboBox filter to this Items code so that the gallery is filtered by both statements. This is my combobox code, which works on its own:

Filter('Task Tracker (Testing)', Combo_AssignedTo_2.Selected.DisplayName = AssignedTo.DisplayName || Combo_AssignedTo_2.Selected.DisplayName = Blank())



This is the closest I have come to getting it to work, however it involved using a textinput and has delegation warnings which I hope to avoid:

Filter(
'Task Tracker (Testing)',
StartsWith(
AssignedTo.DisplayName,
srch_Search.Text
) && If(
varFilterBy = "Completed",
Completion = 100,
If(
varFilterBy = "Outstanding",
Completion < 100,
If(
varFilterBy = "Overdue",
And(
DueDate < Today(),
Completion < 100
),
If(
varFilterBy = "DueToday",
And(
DueDate = Today(),
Completion < 100
),
If(
varFilterBy = "Upcoming",
And(
DueDate >= varToday,
DueDate <= varOneWeekFromNow,
Completion < 100
),
If(
varFilterBy = "All",
true,
false
)))))))



Any advice would be appreciated as I am sure there must be a more efficient way to do this. Thanks.

 

Categories:
I have the same question (0)
  • Verified answer
    RhysGB Profile Picture
    10 on at

    For anyone who comes across this and is interested in a solution, this worked:

    Filter(
     'Task Tracker (Testing)',
     Combo_AssignedTo_2.Selected.DisplayName = AssignedTo.DisplayName || Combo_AssignedTo_2.Selected.DisplayName = Blank(),
     varFilterBy = "Completed" && Completion = 100 || varFilterBy = "Outstanding" && Completion < 100 || varFilterBy = "DueToday" && And(
     DueDate = Today(),
     Completion < 100
     ) || varFilterBy = "Overdue" && And(
     DueDate < Today(),
     Completion < 100
     ) || varFilterBy = "Upcoming" && And(
     DueDate >= varToday,
     DueDate <= varOneWeekFromNow,
     Completion < 100
     ) || varFilterBy = "All" && 1 = 1
    )
  • v-xiaochen-msft Profile Picture
    on at

    Hi @RhysGB ,

     

    Glad to see you solved the issue.

    Please consider marking your own reply as the solution.

     

    Best Regards,

    Wearsky

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 301 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 297 Most Valuable Professional

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 195

Last 30 days Overall leaderboard