SUBSTITUTE DAX Function (Text)

Replaces existing text with new text in a text string.


SUBSTITUTE ( <Text>, <OldText>, <NewText> [, <InstanceNumber>] )
Parameter Attributes Description

A string of text, or a reference to a cell containing text, in which you want to substitute characters.


The existing text you want to replace. If the case of old_text does not match the case in the existing text, SUBSTITUTE will not replace the text.


The text you want to replace old_text with.

InstanceNumber Optional

The occurrence of old_text you want to replace. If omitted, every instance of old_text is replaced.

Return values

Scalar A single string value.

The modified string.


Use the SUBSTITUTE function to replace specific text in a text string; use the REPLACE function to replace any text of variable length that occurs in a specific location in a text string.

The SUBSTITUTE function is case-sensitive. If case does not match between Text and OldText, SUBSTITUTE will not replace the text.

Related articles

Learn more about SUBSTITUTE in the following articles:

  • From SQL to DAX: String Comparison

    In DAX string comparison requires you more attention than in SQL, for several reasons: DAX doesn’t offer the same set of features you have in SQL, a few text comparison functions in DAX are only case-sensitive and others only case-insensitive,… » Read more

Related functions

Other related functions are:

Last update: Nov 20, 2020   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo, Kenneth Barber

MSDN documentation:

Black Friday
2018-2020 © SQLBI. All rights are reserved. Information coming from MSDN is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.


Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.


This function is deprecated. Jump to the Alternatives section to see the function to use.


This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.


Want to improve the content of SUBSTITUTE? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.