cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

filter gallery All Value with 2 Drop down List

Dear PowerGuys

 

I need to return All Item on gallery when I Select 2 drop down list.

   Dropdows1 item = ["2020","2021","2022"]                 Column : Year

   Dropdown2 item = ["","Site1","Site2","Site3"]             Column : Site

 

Now I Can filter by dropdown2 only but if need to filter with dropdows1 link to dropdown2 it posible?

1. when I select dropdown2 is blank  , will show all value in Site1 , Site2 and Site3 ,  now it's working properly as formula belows. but bot filter by year.

2. if i need to filter 2 dropdows list  then I select is "2020" or "2021"  or "2022" in Dropdows1  and Select Blank in Dropdows2    - Expect result will show all value in gallery year by year only.

Please.

 

If(Dropdown1.Selected.Value="",

SharePointList,

Filter('SharePointList', Site = Dropdown2.Selected.Value && Year = Dropdown1.Selected.Value))

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: filter gallery All Value with 2 Drop down List

Hi @Art_Ratta 

 

If(
    IsBlank(
            Dropdown1.Selected.Value
     ) && IsBlank(
                   Dropdown2.Selected.Value
           ), SPlist,
    IsBlank(
            Dropdown1.Selected.Value
    ), 
        Filter(
               SPlist, Site = Dropdown2.Selected.Value
         ),
    IsBlank(
             Dropdown2.Selected.Value
     ),
        Filter(
           SPlist, Year = Dropdown1.Selected.Value
         ),
      Filter(SPlist, Site = Dropdown2.Selected.Value && Year = Dropdown1.Selected.Value
      )
)

 

The above formula in the Items property of the gallery should do the following:

If both dropdowns are blank, then the entire list is shown

If Dropdown1 is blank but Dropdown2 contains a value, then the list will be filtered by Dropdown2

If Dropdown2 is blank but Dropdown1 contains a value, then the list will be filtered by Dropdown1

If both Dropdown1 or Dropdown2 contain values, then the list will be filtered by both dropdowns. 

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

Re: filter gallery All Value with 2 Drop down List

Try:

If(Dropdown1.Selected.Value="" Or

Dropdown2.Selected.Value="",

SharePointList,

Filter('SharePointList', Site = Dropdown2.Selected.Value Or Year = Dropdown1.Selected.Value))

 

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Highlighted
Super User
Super User

Re: filter gallery All Value with 2 Drop down List

Hi @Art_Ratta 

 

If(
    IsBlank(
            Dropdown1.Selected.Value
     ) && IsBlank(
                   Dropdown2.Selected.Value
           ), SPlist,
    IsBlank(
            Dropdown1.Selected.Value
    ), 
        Filter(
               SPlist, Site = Dropdown2.Selected.Value
         ),
    IsBlank(
             Dropdown2.Selected.Value
     ),
        Filter(
           SPlist, Year = Dropdown1.Selected.Value
         ),
      Filter(SPlist, Site = Dropdown2.Selected.Value && Year = Dropdown1.Selected.Value
      )
)

 

The above formula in the Items property of the gallery should do the following:

If both dropdowns are blank, then the entire list is shown

If Dropdown1 is blank but Dropdown2 contains a value, then the list will be filtered by Dropdown2

If Dropdown2 is blank but Dropdown1 contains a value, then the list will be filtered by Dropdown1

If both Dropdown1 or Dropdown2 contain values, then the list will be filtered by both dropdowns. 

View solution in original post

Highlighted
Super User
Super User

Re: filter gallery All Value with 2 Drop down List

In the screenshot below, the button was used to create a collection of the dataset of Fake Names so that it included a blank row.  This collection was used in the items properties of both dropdown controls.  In addition, the city dropdown is filtered by the state dropdown.  The items property for the dropdown is below it.  The data table is filtered according to the two dropdown controls.  If both are blank then all the items in the datasource are included, otherwise it is filtered by one or both of the dropdown controls according to the Items property shown below the data table. 
Annotation 2020-06-18 111702.png

Highlighted
Helper II
Helper II

Re: filter gallery All Value with 2 Drop down List

@Drrickryp  it's working. thank you

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,481)