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

Dynamic filtering on a gallery/table

Hi, I'm trying to create a dynamic filtering on a gallery/table and I'm a little bit lost so it would be great if someone can help.

 

In my scenario I have a table with 3 columns:

Level 1Level 2Level 3
A1B1C1
A1B1C2
A1B2C3
A1B2C4
A2B3C5
A2B3C6
A2B4C7
A2B4C8

 

Now I would like to have 3 dropdowns to filter this table with the distinct values of each columns, with the following functionality:

- The values are unique

- The values depend on the previous level selected date.

 

For example:

- the items for L1 dropdown are A1 and A2 - always

- the items for L2 dropdown are B1, B2, B3, B4 - but if I select in L1 A1 I will see only B1 and B2.  If I select in L1 A2 I will see only B3 and B4.

- the items for L3 dropdown are C1 .. C8 - but If I select A2 and B4 I will see only C7 and C8.

 

At the end, when you selected in the dropdowns A1-B1-C1, you will see the record in the table below.

 

At the moment I am able to see the items using Distinct(Collection,Column) but I am not sure on how to filter it in the second level.

I've tried to use the OnChange property of the L1 Dropdown to something like L2.Items=Distinct(Filter(Collection, L1=L1.Selected),L2) // Syntaxis only for reference // but it is not working

 

Any idea on how I can achieve this? 

 

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Delid4ve
Level 10

Re: Dynamic filtering on a gallery/table

Dropdown1 Items:

Distinct(TableName,"Level1")

 

Dropdown2 Items:

Distinct(Filter(TableName,Level1 = Dropdown1.Selected.Result),"Level2")

 

Dropdown3 Items:

Distinct(Filter(TableName,Level1 = Dropdown1.Selected.Result And Level2 = Dropdown2.Selected.Result),"Level3")

DataTable Items Property = Filter(TableName,Level3 = Dropdown3.Selected.Result)

View solution in original post

3 REPLIES 3
Highlighted
Delid4ve
Level 10

Re: Dynamic filtering on a gallery/table

Dropdown1 Items:

Distinct(TableName,"Level1")

 

Dropdown2 Items:

Distinct(Filter(TableName,Level1 = Dropdown1.Selected.Result),"Level2")

 

Dropdown3 Items:

Distinct(Filter(TableName,Level1 = Dropdown1.Selected.Result And Level2 = Dropdown2.Selected.Result),"Level3")

DataTable Items Property = Filter(TableName,Level3 = Dropdown3.Selected.Result)

View solution in original post

Community Support Team
Community Support Team

Re: Dynamic filtering on a gallery/table

Hi @Sam4 ,

 

A little adjustment of @Delid4ve 's reply:

 

Dropdown1 Items:

Distinct(TableName,Level1)

 

Dropdown2 Items:

Distinct(Filter(TableName,Level1 = Dropdown1.Selected.Result),Level2)

 

Dropdown3 Items:

Distinct(Filter(TableName,Level1 = Dropdown1.Selected.Result && Level2 = Dropdown2.Selected.Result),Level3)

DataTable Items Property = Filter(TableName,Level3 = Dropdown3.Selected.Result)

 

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Sam4
Level: Powered On

Re: Dynamic filtering on a gallery/table

@v-monli-msft , @Delid4ve 

 

Many thanks for your replies and apologies for the late reply. I've been disconnected for a while for some personal circumstances. Now I'm back I can confirm it is working fine.

 

Thanks a lot.

 

Kind Regards

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,441)