List.Intersect Function in Power Query

The List.Intersect function in Power Query, is used to find the common elements (intersection) among two or more lists.

Syntax

List.Intersect(lists as list, optional equationCriteria as any) as list

The function has the following parameters:

Returns It returns output as a list.

Example:

Power Query M

let
    Source = List.Intersect({{"Ashish", 1, 5}, {"Hemant", "Ashish", 1, 7}, {6, 8, 1, "Ashish"}})
in
    Source        

The output of the above code is shown below:

List.Intersect function in Power Query

Tip:

To make the function dynamic, we can pass a list of lists generated from table columns using Table.Column.

Example:

Power Query M

let
    Source = List.Intersect({Table1[Column1], Table2[Column2]})
in
    Source