Documentation
-
List.ReplaceValue - PowerQuery M
Learn more about: List.ReplaceValue
-
Learn more about: List.Repeat
-
Learn more about: List.Select
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
List.ReplaceMatchingItems(list as list, replacements as list, optional equationCriteria as any) as list
Performs the given replacements to the list list
. A replacement operation replacements
consists of a list of two values, the old value and new value, provided in a list. An optional equation criteria value, equationCriteria
, can be specified to control equality testing.
Create a list from {1, 2, 3, 4, 5} replacing the value 5 with -5, and the value 1 with -1.
Usage
List.ReplaceMatchingItems({1, 2, 3, 4, 5}, {{5, -5}, {1, -1}})
Output
{-1, 2, 3, 4, -5}
Documentation
List.ReplaceValue - PowerQuery M
Learn more about: List.ReplaceValue
Learn more about: List.Repeat
Learn more about: List.Select