List.Difference

The function returns the elements from list1 that are not found in list2. Duplicate values are allowed. Users can provide an optional equation criteria value, equationCriteria, to determine how equali...

Syntax

List.Difference(list1 as list, list2 as list, optional equationCriteria as any) as list

About

The function returns the elements from list1 that are not found in list2. Duplicate values are allowed. Users can provide an optional equation criteria value, equationCriteria, to determine how equality is assessed.

Explanation

Identify the elements in the set {1, 2, 3, 4, 5} that are not present in the set {4, 5, 3}. To do this, use the Power Query MList.Difference function as follows: MList.Difference({1, 2, 3, 4, 5}, {4, 5, 3}) The output will be the set {1, 2}. --- Determine the elements in the set {1, 2} that are not included in the set {1, 2, 3}. To accomplish this, utilize the Power Query MList.Difference function with the following syntax: MList.Difference({1, 2}, {1, 2, 3}) The result will be an empty set.