List.ReplaceValue

This function scans a specified list of values for a target value called 'oldValue' and swaps out every instance with a new value called 'newValue'.

Syntax

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

About

This function scans a specified list of values for a target value called 'oldValue' and swaps out every instance with a new value called 'newValue'.

Explanation

Substitute the "a" values in the set {"a", "B", "a", "a"} with "A" using Power Query MList.ReplaceValue({"a", "B", "a", "a"}, "a", "A", Replacer.ReplaceText) resulting in {"A", "B", "A", "A"}.