Cheat Sheets/Power BI/SUBSTITUTE
DAX function

SUBSTITUTEDAX function reference

Replace text by match.

Syntax

dax
SUBSTITUTE(<text>, <old_text>, <new_text>, [<instance_num>])

Examples

dax
SUBSTITUTE([Code], "-", "")
Text
dax
SUBSTITUTE(SUBSTITUTE(Product[SKU], "-", ""), " ", "")
Strips both dashes and spaces from a SKU for matching another system's format
dax
SUBSTITUTE(Customer[Phone], "+1", "", 1)
Removes only the first occurrence of a country-code prefix, via the optional instance_num argument

Common mistakes & gotchas

Related DAX functions

From Text

Used in these tutorials

← Back to the Power BI (DAX) cheat sheet