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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Zyg_D
Continued Contributor
Continued Contributor

Alternative to SQL IN operator - Power Query M formula language

What is the best SQL IN alternative using Power Query M formula language (not DAX)? 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Zyg_D , In DAX you have In

 

Table[Col] in {"1","2","3"}

Table[value] in {1,2,3}

 

Power Query it will be

List.Contains({'Value1', 'Value2', 'Value3'}, [Column1])

refer

https://stackoverflow.com/questions/51740679/power-query-m-the-in-operator

https://community.powerbi.com/t5/Desktop/IN-OPERATOR-in-PowerBi/td-p/174285

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Zyg_D - In Power Query, there are numerous ".Contains" functions for elements like List, Table, Text, etc.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@Zyg_D , In DAX you have In

 

Table[Col] in {"1","2","3"}

Table[value] in {1,2,3}

 

Power Query it will be

List.Contains({'Value1', 'Value2', 'Value3'}, [Column1])

refer

https://stackoverflow.com/questions/51740679/power-query-m-the-in-operator

https://community.powerbi.com/t5/Desktop/IN-OPERATOR-in-PowerBi/td-p/174285

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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