cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ejbrazell Frequent Visitor
Frequent 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

Accepted Solutions
MarcelBeug Super Contributor
Super Contributor

Re: Power BI Newbie - Using Not In

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)
2 REPLIES 2
MarcelBeug Super Contributor
Super Contributor

Re: Power BI Newbie - Using Not In

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)
ejbrazell Frequent Visitor
Frequent Visitor

Re: Power BI Newbie - Using Not In

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
GregDeckler

How to Get Your Question Answered Quickly

Power BI Super User, Greg Deckler, explains

Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Ideas
Users Online
Currently online: 69 members 1,061 guests
Please welcome our newest community members: