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
Syntax
Replacer.ReplaceText(
text as nullable text,
old as text,
new as text,
) as nullable text
Description
Replaces the old
text in the original text
with the new
text. This replacer function can be used in List.ReplaceValue
and Table.ReplaceValue
.
Examples
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:
Related functions
Other functions related to Replacer.ReplaceText are:
