Text.Remove
TextRemoves all occurrences of specified characters from a text value.
Syntax
Text.Remove(text as nullable text, removeChars as any) as nullable textParameters
| Name | Type | Required | Description |
|---|---|---|---|
text | text | Yes | The text value to remove characters from. |
removeChars | any | Yes | A single character or list of characters to remove. |
Return Value
text — The text with all specified characters removed.
Remarks
Text.Remove strips all occurrences of one or more characters from a text value. Unlike Text.Replace, which replaces substrings, Text.Remove works with individual characters — pass a list of characters to remove multiple character types at once.
This is ideal for stripping non-numeric characters from phone numbers, removing punctuation, or cleaning formatting characters.
Examples
Example 1: Extract digits from phone numbers
Table.AddColumn(
Table.SelectColumns(Table.FirstN(Employees, 3), {"Phone"}),
"DigitsOnly", each Text.Remove([Phone], {"(", ")", " ", "-"}), type text
)Result
Phone | DigitsOnly | |
|---|---|---|
| 1 | (555) 123-4567 | 5551234567 |
| 2 | (555) 234-5678 | 5552345678 |
| 3 | (555) 345-6789 | 5553456789 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks