cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sam4
Resolver I
Resolver I

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
Delid4ve
Impactful Individual
Impactful Individual

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
Delid4ve
Impactful Individual
Impactful Individual

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

v-monli-msft
Community Support
Community Support

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.

@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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (55,391)