How does the SUBSTITUTE function (DAX) work?

The SUBSTITUTE function (DAX) replaces existing text with new text in a text string.

SUBSTITUTE Formula Syntax

     <text>, <old_text>, <new_text>, <instance_num>

How do you use the SUBSTITUTE function?

The SUBSTITUTE function can replace text by matching. Use the SUBSTITUTE function when you want to replace text based on its content, not position. Optionally, you can specify the instance of found text to replace (i.e. first instance, second instance, etc.).

Related Blog Posts

Related Support Forum Posts

Replacing Substitute from Excel
Today vs Yesterday
Sales from a specific date

Considerations when using the SUBSTITUTE function

  • SUBSTITUTE finds and replaces old_text with new_text in a text string.
  • Instance limits SUBSTITUTE replacement to one particular instance of old_text. if not supplied, all instances of old_text are replaced with new_text.
  • Use SUBSTITUTE to replace text based on content. Use the REPLACE function to replace text based on its location.
  • SUBSTITUTE is case-sensitive and does not support wildcards.

Related Video Tutorials

Formula examples using the SUBSTITUTE function

=SUBSTITUTE([Product Code], “NW”, “PA”)



Related DAX Functions


Related Course Modules



Download our comprehensive DAX Formula Reference Guide as perfect companion as you learn how to use DAX formulas within Power BI.

Download DAX Formulas Reference Guide
Download DAX Formula Reference Guide