Skip to content

Automatic translation — the Portuguese version is the reference. View in Portuguese

SUBSTITUIR

On this page (10)

Replaces all occurrences of a substring.

FieldValue
CategoryText
TypeScalar (operates value by value)
Arity3 arguments (fixed)
Compiles to SQL (calculated column)Yes
VersionFormula engine v3.

Aliases#

Canonical name: SUBSTITUIR. Accepted aliases (case-insensitive): substitute, replace.

Syntax#

code
SUBSTITUIR(expr; arg2; arg3)

All arguments are expressions.

Returns#

Text.

Null handling#

Blank becomes empty text ("").

Evaluation context#

Scalar — evaluated on the result of the arguments (in calculated columns, it runs row by row).

Differences from DAX#

  • DAX equivalent: SUBSTITUTE
  • Compatibility: DIFFERS from DAX — different semantics, watch out
  • Note: Replaces ALL occurrences by content (like SUBSTITUTE). The replace alias is NOT the position-based REPLACE from DAX/Excel.

Examples#

code
SUBSTITUIR(sku; "-"; "")

Example with values#

Input: "A-B-C", replaces "-" with "".

code
SUBSTITUIR("A-B-C"; "-"; "")  →  "ABC"

Expected result: "ABC"

Business example#

Clean up the SKU by removing hyphens before matching it against another dataset.

Common errors#

Typos in a column name, an incompatible type, or an invalid argument become a friendly message (pt-BR) — the engine never silently returns a wrong number.


← Back to the formula index

Related links