Replacer.ReplaceValue

Replacer

A replacer function that performs exact match replacement of entire cell values.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Replacer.ReplaceValue as function

Return Value

functionA replacer function that replaces a cell value only when it exactly matches the old value.

Remarks

Replacer.ReplaceValue is a built-in replacer function used as an argument to Table.ReplaceValue. It performs exact match replacement — the entire cell value must equal oldValue for the replacement to occur.

Key difference from Replacer.ReplaceText: Replacer.ReplaceValue matches and replaces the whole cell value, while Replacer.ReplaceText performs substring replacement within text values. Use Replacer.ReplaceValue when replacing nulls, numbers, or exact text matches. Use Replacer.ReplaceText for find-and-replace within strings.

Examples

Example 1: Replace exact region values

Table.SelectColumns(
    Table.ReplaceValue(
        Table.FirstN(Sales, 4),
        "West", "Western",
        Replacer.ReplaceValue, {"Region"}
    ),
    {"CustomerName", "Product", "Region"}
)
Result
CustomerName
Product
Region
1AliceWidget AEast
2BobGadget BWestern
3CharlieWidget CEast
4AliceGadget DNorth

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks