Search code examples
powerbipowerquerym

Power query M the IN operator


What would be equivalent of SQL IN operator for Power BI. Just like in clause:

where [Column1] IN ('Value1', 'Value2', 'Value3')

I am looking for M solution (not DAX).


Solution

  • You can use the List.Contains function.

    For example,

    = Table.SelectRows(Table1, each List.Contains({ "Value1", "Value2", "Value3" }, [Column1]))
    

    will filter Table1 to include only rows where [Column1]'s value is contained in the given list.