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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
cgkas
Helper V
Helper V

How to shorten multiple OR conditions when filtering column in Power Query

Hello to all,

 

I Have to filter Column1 (Col1) for values A, B, C, D, E or F doing this:

= Table.SelectRows(#"Previous Step", each ([Col1] = "A" or [Col1] = "B" or [Col1] = "C" or [Col1] = "D" or [Col1] = "E" or [Col1] = "F"))

If I have several OR conditions is possible to do in a shortest way?, something similar to this?

= Table.SelectRows(#"Previous Step", each ([Col1] = {"A","B","C","D","E","F"}))

Thanks in advance

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @cgkas,

Try List.Contains. Something like:

 

Table.SelectRows(#"Previous Step", each (List.Contains({"A","B","C","D","E","F"},[Col1])))

 

View solution in original post

4 REPLIES 4
AlB
Community Champion
Community Champion

Hi @cgkas,

Try List.Contains. Something like:

 

Table.SelectRows(#"Previous Step", each (List.Contains({"A","B","C","D","E","F"},[Col1])))

 

Many thanks AIB,

 

It seems to work. 

 

I know is another question, only to know if it is possible to use wildcards (regex) to shorten even more. Something like this:

 

Table.SelectRows(#"Previous Step", each (List.Contains({"AB*","BC*"},[Col1])))

 

 

AlB
Community Champion
Community Champion

@cgkas 

In this case you could use

List.Contains({"A".."F"},[Col1])

which will include all letters between A and F.

As for the wildcards, maybe this posting will be useful

Excellent. Thank you AIB for your kind help.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.