cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MickM
Level: Powered On

Gallery Filtering By 2x Dropdowns

Hi Everyone,

I've done some extensive searching and tried multiple methods from this forum without any success thus far.

Hoping somebody can help me out.

 

I have a Table (Table2). It contains all my data, example below.

I have 2 drop downs (Dropdown1 & Dropdown2) Need to be distinct values listed.

I have a gallerylist (TemplateGalleryList1)

 

I want to filter based firstly on "Model" then secondly by "MaxSG"

Heres my basic setup which half worked. The model filter worked fine, the maxsg not so great.

Distinct(Table2,Model)
Distinct(Sort(Table2,MaxSG),MaxSG)
Filter(Table2,Model = Dropdown1.Selected.Value)

 

Bonus points if i can select "MaxSG" and all values are returned for rows that meet the criteria equal or less than the MaxSG value, also if they're cascading would be good. as in, filter Dropdown2 based on selection in Dropdown1.

 

Example of the data.

 

Unique# - Model - MaxSG - OtherData1 - OtherData2

0001 - 234 - 1900 - xyz - 123

0002 - 275 - 2200 - xyz - 123

0003 - 275 - 2300 - xyz - 123

0004 - 275 - 2500 - xyz - 123

0005 - 298 - 2200 - xyz - 123

0006 - 298 - 2500 - xyz - 123

0007 - 301 - 2500 - xyz - 123

 

Any help would be very much appreciated.

Thanks Smiley Happy

 

1 ACCEPTED SOLUTION

Accepted Solutions
OneThing
Level 8

Re: Gallery Filtering By 2x Dropdowns

Hi @MickM,

 

I've put together a quick example app from what I think you are looking for.

Screenshot_1.png

Basically Dropdown1:

Items: Distinct(Table2,Model)
OnChange: ClearCollect(Table2Results,Filter(Table2,Model = Dropdown1.Selected.Result))

Dropdown2:
Items: Distinct(Filter(Table2,Model = Dropdown1.Selected.Result).MaxSG,MaxSG)

OnChange: ClearCollect(Table2Results,Filter(Table2,MaxSG <= Dropdown2.Selected.Result && Model = Dropdown1.Selected.Result))

 

and a Gallery with:

Items: Table2Results

 

I've set this if you change Dropdown 1 is will give you all MaxSG entries with this Model. If you then select the MaxSG (Dropdown2) it will then give you all entries with a MaxSG less than or equal to the selected value.

 

Not 100% sure this is what you are after, but this should hopefully give you a start.

 

Thanks,
Nicky 

2 REPLIES 2
OneThing
Level 8

Re: Gallery Filtering By 2x Dropdowns

Hi @MickM,

 

I've put together a quick example app from what I think you are looking for.

Screenshot_1.png

Basically Dropdown1:

Items: Distinct(Table2,Model)
OnChange: ClearCollect(Table2Results,Filter(Table2,Model = Dropdown1.Selected.Result))

Dropdown2:
Items: Distinct(Filter(Table2,Model = Dropdown1.Selected.Result).MaxSG,MaxSG)

OnChange: ClearCollect(Table2Results,Filter(Table2,MaxSG <= Dropdown2.Selected.Result && Model = Dropdown1.Selected.Result))

 

and a Gallery with:

Items: Table2Results

 

I've set this if you change Dropdown 1 is will give you all MaxSG entries with this Model. If you then select the MaxSG (Dropdown2) it will then give you all entries with a MaxSG less than or equal to the selected value.

 

Not 100% sure this is what you are after, but this should hopefully give you a start.

 

Thanks,
Nicky 

Highlighted
MickM
Level: Powered On

Re: Gallery Filtering By 2x Dropdowns

@OneThing Wow! Absolutely excellent repsonse, thankyou so much for that! Worked instantly.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 54 members 3,952 guests
Please welcome our newest community members: