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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
BIXL
Resolver I
Resolver I

convert sql "in" statement to power query filter code

Hi all,

I have a sql statment that has where clouse that uses the "in" statement that has a large number of elements in it

like :

select col1,col2 

fromTABLE X

where  col1 in ('abc','aaaa',ddd,'zxs','q','w'.......and so on).

 

I am looking for an easy smart way to convet this into power query single filter command.

 

Thanks

 

1 REPLY 1
v-haibl-msft
Microsoft Employee
Microsoft Employee

@BIXL

 

You can try with following power query in Advance Editor of PBI Desktop.

#"Filtered Rows" = Table.SelectRows(#"Changed Type", each [col1] = "abc" or [col1] = "aaaa" or [col1] = "ddd" or [col1] = "zxs" or [col1] = "q" or [col1] = "w")

convert sql in statement to power query filter code_1.jpg

 

Best Regards,

Herbert

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.