Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
Solved! Go to Solution.
Hi @cgkas,
Try List.Contains. Something like:
Table.SelectRows(#"Previous Step", each (List.Contains({"A","B","C","D","E","F"},[Col1])))
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])))
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
54 | |
54 | |
37 | |
29 |
User | Count |
---|---|
78 | |
64 | |
45 | |
40 | |
40 |