Replacer.ReplaceText is a Power Query M function that replaces old text in the original text with new text. The function returns a replacer function for use in List.ReplaceValue and Table.ReplaceValue.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365


   text as nullable text,
   old as text,
   new as text,
) as nullable text


Replaces the old text in the original text with the new text. This replacer function can be used in List.ReplaceValue and Table.ReplaceValue.


Replace the text “hE” with “He” in the string “hEllo world”.

// Output: "Hello world"
Replacer.ReplaceText( "hEllo world", "hE", "He" )

Used by

While the Replacer.ReplaceText function can be used on its own, it is also used by the following functions:

Other functions related to Replacer.ReplaceText are:

BI Gorilla Youtube Channel

Last update: November 17, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation:
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.