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
ejbrazell
Regular Visitor

Power BI Newbie - Using Not In

For give my ignorance but I am learning Power Query commands (M).  Can someone help me with the equivalent statement in Power BI for this SQL code.

SQL Statement

Select * from MyTable where Field1 not in ("AB", "AC", "FG")

 

Power BI Equivalent

= Table.SelectRows(MyTable, Each [Field1] ????????????

 

Or is there a better way.

1 ACCEPTED SOLUTION
MarcelBeug
Community Champion
Community Champion

Probably you would have an answer much sooner if you posted your question in the "Desktop"  forum.

 

Anyhow, this will do the trick:

= Table.SelectRows(MyTable, each not List.Contains({"AB", "AC", "FG"}, [Field1]))

 

Specializing in Power Query Formula Language (M)

View solution in original post

2 REPLIES 2
MarcelBeug
Community Champion
Community Champion

Probably you would have an answer much sooner if you posted your question in the "Desktop"  forum.

 

Anyhow, this will do the trick:

= Table.SelectRows(MyTable, each not List.Contains({"AB", "AC", "FG"}, [Field1]))

 

Specializing in Power Query Formula Language (M)

Thanks, it works like a charm. 

 

As I look closer at the forum areas, I see what you mean about where I should have posted.  Looking closer at the developer area questions, I see the type of development work that is taking place there.

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.