The Substitute function in Power Apps is used to replace occurrences of specific text within a string with provided value. It’s useful when you want to change part of a string or clean up a string by replacing unwanted characters or words.
Syntax:
Substitute(Text, OldText, NewText, [InstanceNumber])
- Text: The original string in which you want to replace text.
- OldText: The text you want to find and replace.
- NewText: The text that will replace OldText.
- InstanceNumber (optional): Specifies which instance of OldText to replace. If omitted, all instances will be replaced.
Example of using substitue function
Replace the occurence of string
Replace the “Sales” with “Monthly Sales (in $)” in a string: “Sales Data”.
Following formula will find for the word “Sales” in the original string “Sales Data” and replace “Sales” with “Monthly Sales (in $)” and returns the string“Monthly Sales (in $) Data”.
Substitute( Â "Sales Data", Â "Sales", Â "Monthly Sales (in $)" )

Replace a specific instance
You can replace a specific instance of a string within another string using the Substitute function for this you need to provide the fourth argument of the Substitute function, called InstanceNumber.
This argument specifies which occurrence (or instance) of the string you want to replace.
To replace only the second occurrence of “Power” with “Microsoft Power” in a string “Hello, Power User. Welcome to the Power BI community !”.
Following formula replace the second occurenece of string “Power” with “Microsoft Power” within a string “Hello, Power User. Welcome to the Power BI community !”.
Substitute( Â "Hello, Power User. Welcome to the Power BI community !", Â "Power", Â "Microsoft Power", Â 2 )
It returns the string “Hello, Power User. Welcome to the Microsoft Power BI community !”

Also Read..
- Patch function in Power Apps
- Sequence function in Power Apps
- UpdateIf functon in Power Apps
- RemoveIf function in Power Apps
- Text function to format date/time or numbers to text string
- With function in Power Apps
- Filter function in Power Apps
![]()
