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 Gallery on 3 Dr...
Power Apps
Answered

FIlter Gallery on 3 Dropdown Boxes

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi!

 

I have a gallery which is connected to a SharePoint List. I want to filter the results down based on the values in these dropdown boxes.

 

For example:

  • List
    • ABC, UK, Office Supplies
    • XYZ, USA, IT Software, Legal Software
    • 123, UK, IT Software, Legal Software
    • 456, Germany, Office Supplies
    • MNO, Germany, IT Hardware
    • TUT, France, IT Hardware
    • RSD, UK, IT Software, HR Software
  •  Dropdowns
    • Location
    • Vendor Type
    • Software Type (only visible if Vendor Type is "IT Software")

 I want to be able to filter using the drop downs independently and also together.

 

So that if I chose Location only and selected "UK" the results would be:

  • ABC
  • 123
  • RSD

If I was to select UK as the location and IT Software as the Vendor Type the results would be:

  • 123
  • RSD

And if I was to select UK as the location, IT Software as the Vendor Type and the Software Type as HR System, the results would be:

  • RSD

Here is my code. However, the filters stop working as soon as I select a second filter. What should the correct code be?

 

If(
   //All, All, All                 
    LocationDrop.Selected.Value = "Choose a location" And VendorTypeDrop.Selected.Value = "Choose a vendor type" And SoftwareVendorTypeDrop.Selected.Value = "Choose a software vendor type",
       'Vendor App',
   
       //Location selected, Vendor and Software not
       LocationDrop.Selected.Value <> "Choose a location" And VendorTypeDrop.Selected.Value = "Choose a vendor type" And SoftwareVendorTypeDrop.Selected.Value = "Choose a software vendor type",
          Filter('Vendor App', 'Location'.Value = LocationDrop.Selected.Value),
  
          //Vendor selected, Location and Software not
  VendorTypeDrop.Selected.Value <> "Choose a vendor type" And  LocationDrop.Selected.Value = "Choose a location" And  SoftwareVendorTypeDrop.Selected.Value = "Choose a software vendor type",
Filter('Vendor App', 'Vendor Category'.Value = VendorTypeDrop.Selected.Value),
  
  //Software selected, Location and Vendor not
SoftwareVendorTypeDrop.Selected.Value <> "Choose a software vendor type" And LocationDrop.Selected.Value = "Choose a location" And VendorTypeDrop.Selected.Value = "Choose a vendor type",
Filter('Vendor App', 'Software Sub Category'.Value = SoftwareVendorTypeDrop.Selected.Value),
 
//Everything Selected
             Filter('Vendor App', 'Location'.Value = LocationDrop.Selected.Value And 'Vendor Category'.Value = VendorTypeDrop.Selected.Value And 'Software Sub Category'.Value = SoftwareVendorTypeDrop.Selected.Value)
            )
        
Categories:
  • Verified answer
    CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @s_tanswell84, 

    I think that you miss two conditions there -

    1. When location is not selected, and the other two are.

    2. When software vendor type is not selected and the other two are.

    I didn't took in consideration the option when location and software vendor type are selected because this situation cannot appear (vendor type must be IT Software to select software vendor type).

     

    So what I propose, although is not a the most "programmatic" way of thinking gives you a readable form of this complex condition:

    With(
     {
     location:LocationDrop.Selected.Value,
     vendorType:VendorTypeDrop.Selected.Value,
     softwareType:SoftwareVendorTypeDrop.Selected.Value
    },
    Switch(
     true,
     location <> "Choose a location" && vendorType <> "Choose a vendor type" && softwareType <> "Choose a software vendor type",
     Filter('Vendor App', 'Location'.Value = location && 'Vendor Category'.Value = vendorType && 'Software Sub Category'.Value = softwareType),
     location <> "Choose a location" && vendorType <> "Choose a vendor type" && softwareType = "Choose a software vendor type",
     Filter('Vendor App', 'Location'.Value = location && 'Vendor Category'.Value = vendorType),
     location <> "Choose a location" && vendorType = "Choose a vendor type",
     Filter('Vendor App', 'Location'.Value = location),
     location = "Choose a location" && vendorType <> "Choose a vendor type" && softwareType <> "Choose a software vendor type",
     Filter('Vendor App', 'Vendor Category'.Value = vendorType && 'Software Sub Category'.Value = softwareType), 
     location = "Choose a location" && vendorType <> "Choose a vendor type" && softwareType = "Choose a software vendor type",
     Filter('Vendor App', 'Vendor Category'.Value = vendorType), 
     'Vendor App' 
    )
     

     

    Anyway please take in consideration delegation issues might arise for large list as the formula is not delegable to Sharepoint server. 

    Hope it helps !

  • s_tanswell84 Profile Picture
    Microsoft Employee on at

    Thank you so much @gabibalaban! That is great!

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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard