List.ReplaceValue

 

This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.

Searches a list of values for the value and replaces each occurrence with the replacement value.

List.ReplaceValue(list as list,  oldValue as any, newValue as any,  replacer as function) as list  

ArgumentDescription
listThe List to modify.
oldValueThe value to replace.
newValueThe new value to replace with.
replacerA function provided as replacer determines the kind of values that are being replaced. Built-in functions be be used such as Replacer.ReplaceText and Replacer.ReplaceValue.
List.ReplaceValue({"a", "B", "a", "a"}, "a", "A", Replacer.ReplaceText) equals {"A", "B", "A", "A"}  

Show: