Power Fx function
Replace — Power Fx function reference
Replace text by position.
Syntax
powerfx
Replace( Text, StartPosition, NumberOfCharacters, NewText )
Examples
powerfx
Replace("2026", 1, 2, "19")→ "1926"
powerfx
Replace(txtAccount.Text, 1, 4, "****")
powerfx
Replace("2026-06-13", 6, 2, "12")Common mistakes & gotchas
- Replace works by character position, not by matching text — use Substitute instead when replacing based on a known substring rather than a fixed position.
- If NumberOfCharacters extends past the end of the string, Replace just replaces through the end rather than erroring.
Related Power Fx functions
From Text