Text.Remove

Text

Removes all occurrences of specified characters from a text value.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Text.Remove(text as nullable text, removeChars as any) as nullable text

Parameters

NameTypeRequiredDescription
texttextYesThe text value to remove characters from.
removeCharsanyYesA single character or list of characters to remove.

Return Value

textThe 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-45675551234567
2(555) 234-56785552345678
3(555) 345-67895553456789

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks