Power Fx function
Substitute — Power Fx function reference
Replace text by match.
Syntax
powerfx
Substitute( Text, OldText, NewText [, InstanceNumber ] )
Examples
powerfx
Substitute("a-b-c", "-", "/")→ "a/b/c"
powerfx
Substitute(txtPhone.Text, "-", "")
powerfx
Substitute("2026-06-13", "-", "/", 1)Common mistakes & gotchas
- Without InstanceNumber, Substitute replaces every occurrence; pass a 1-based number to replace only that specific occurrence.
- Substitute matches exact text only, not patterns — Power Fx has no regex-replace function for pattern-based substitution.
Related Power Fx functions
From Text