Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Filtering Long Table Based on Another Table

 

Hi Guys, how is everything?

I need some help here please. I need to filter a column in a table, long one actually (the first image is a sample of it), to keep only the mentioned names in a column in another table (the second image), to reach the outcome illustrated in the final image (the third image), how could I do that?

 

I think this is reachable thru the "List" concept but I am not pretty sure about the needed script to write, could you help please?

 

 

Magdoulin_0-1631641599539.png

 

Magdoulin_1-1631641664733.png

 

Magdoulin_2-1631641719037.png

 

1 ACCEPTED SOLUTION
watkinnc
Super User
Super User

On your first table, in the formula bar, type:

 

= Table.SelectRows(Source, each List.Contains(List.Distinct(Table2[Name]), [Name]))

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

View solution in original post

3 REPLIES 3
watkinnc
Super User
Super User

On your first table, in the formula bar, type:

 

= Table.SelectRows(Source, each List.Contains(List.Distinct(Table2[Name]), [Name]))

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!
Anonymous
Not applicable

I'm sorry for the bothering again.

 

I've tried to play with the given script a bit and I've applied this:

 

= Table.SelectRows(#"Changed Type", each List.Contains(List.Distinct(#"Removed Other Columns2"), [Agent]))

 

Simply, I'm trying to filter a query table using the same query table at different step, isn't this techinically allowed logically speaking? Yet, I'm getting this error:

 

Expression.Error: We cannot convert a value of type Table to type List.
Details:
Value=[Table]
Type=[Type]

Anonymous
Not applicable

That was quick, thanks a million

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors