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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
akhaliq7
Post Prodigy
Post Prodigy

The equivalent of NOT IN (SQL) in power query

I am currently using a sql native query and wish to use power query instead. I have a select subquery that uses a not in function like the one below:

(
SELECT DISTINCT MAX(column1)
FROM Table1 tb
WHERE tb.id = 1
   AND tb.id3 = base_table.id3
   AND NVL(tb.id, 0) NOT IN (
       SELECT NVL(tb2.id2 1)
       FROM Table1 tb2
       WHERE tb2.id = 11
       )
GROUP BY tb.id
) AS Alias

In the above query I am needing to do not in how would I do that in power query.

I am guessing I need to create two queries for table1 tb and tabl1 tb2

then need to do a not in between them

1 ACCEPTED SOLUTION
Anonymous
Not applicable

It's the equivalent to

 

= Table.SelectRows(TableOrPriorStepName, each not List.Contains(ListOfInValues, [ColumnToCheck]))

 

--Nate

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

It's the equivalent to

 

= Table.SelectRows(TableOrPriorStepName, each not List.Contains(ListOfInValues, [ColumnToCheck]))

 

--Nate

@akhaliq7 Note that what @Anonymous gave is equivalent to a simpler SQL expression:

SELECT *
FROM TableOrPriorStepName
WHERE [ColumnToCheck] NOT IN ListOfInValues

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors