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

Filter collection by values of another collection.

I have two, single column tables from two different sources that I'd like to compare and filter the first table based on whether the values are present in any record of the second table in the different source collection. Example:

Table1
----------
Value1
Value2
Value4
Value5

 

Table2
---------
Value2
Value3
Value5


I would then like Table1 to be filtered to look like

Table1
--------
Value2
Value5


I'm trying to avoid creating a new table in this scenario, which has complicated things a bit. I specifically need to filter the original table, since I'm trying to filter the default items of a combobox and it seems to be very particular about the Items table being the same source as the DefaultSelectedItems table.

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Filter collection by values of another collection.

Hi @AdamD 

 

you can try using the below expression:
Filter(Table1,Column1 in Table2.Column2).Column1
Here Table1 is my first table and Column1 is the name of its column, Same for Table2, it has a column named Column2.
 
The result will be the values from table1 that exist in Table 2MicrosoftTeams-image (90).png

 

Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: Filter collection by values of another collection.

Hi @AdamD 

 

you can try using the below expression:
Filter(Table1,Column1 in Table2.Column2).Column1
Here Table1 is my first table and Column1 is the name of its column, Same for Table2, it has a column named Column2.
 
The result will be the values from table1 that exist in Table 2MicrosoftTeams-image (90).png

 

Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

AdamD
Level: Powered On

Re: Filter collection by values of another collection.

Amazing how much time I've burned away searching for that simple, elegant solution. Thank you! @yashag2255 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,683)