List.ReplaceMatchingItems
Executes the specified substitutions on the list provided. Each substitution is defined by a pair of values indicating the original value and the new value, supplied within a list. An optional equatio...
List.ReplaceMatchingItems(list as list, replacements as list, optional equationCriteria as any) as list
Executes the specified substitutions on the list provided. Each substitution is defined by a pair of values indicating the original value and the new value, supplied within a list. An optional equation criteria value, known as equationCriteria, can be included to determine equality during testing.
Generate a new list by substituting the number 5 with -5, and the number 1 with -1, from the original list {1, 2, 3, 4, 5}. This can be achieved using the Power Query MList function ReplaceMatchingItems with the parameters {1, 2, 3, 4, 5} and {{5, -5}, {1, -1}}. The resulting list will be {-1, 2, 3, 4, -5}.