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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Filtering a query respect a value list for a column

Hi,

I've a query that I need to filter by a column based on a value list.

I'd like to avoid to repeat more times "equals to" + "or" + "equals to" + "or" operations to implement a such filter.

Does it exist a simplified manner to perform that a column value could be equals to one of the values belonging to a list?

Thanks

1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

 

You can use List.Contains, put the numbers in a list -  I put the values in the list exlist

 

Table.SelectRows( #"Changed Type",  each not List.Contains(exList,[Column1]))

 

View solution in original post

3 REPLIES 3
Vera_33
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

 

You can use List.Contains, put the numbers in a list -  I put the values in the list exlist

 

Table.SelectRows( #"Changed Type",  each not List.Contains(exList,[Column1]))

 

Anonymous
Not applicable

Hi Vera,

thanks for your reply.

I've used the statement without "not" operator, to maintain the rows that match with the list.

But it seems that the performance of the data transformation logics are worsened after adding List.Contains.

Any idea?

Try adding ad step before the List.Contains step where you buffer the exList

 

For example - #"New Step" = List.Buffer(exList)

 

And then use #"New Step" instead of exList in your query. Note the List.Buffer needs to be in the same query as described.

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors