Text.TrimEnd
TextRemoves trailing whitespace (or specified characters) from a text value.
Syntax
Text.TrimEnd(text as nullable text, optional trim as any) as nullable textParameters
| Name | Type | Required | Description |
|---|---|---|---|
text | text | Yes | The text value to trim from the end. |
trim | any | No | A single character or list of characters to trim from the end. Defaults to whitespace. |
Return Value
text — The text with trailing whitespace or specified characters removed.
Remarks
Text.TrimEnd removes characters from the end of a text value only. By default it removes whitespace, but you can pass a character or list of characters to trim instead.
Examples
Example 1: Trim trailing characters
Table.AddColumn(
Table.SelectColumns(Table.FirstN(Customers, 3), {"Email"}),
"Trimmed", each Text.TrimEnd([Email]), type text
)Result
Email | Trimmed | |
|---|---|---|
| 1 | alice@example.com | alice@example.com |
| 2 | bob@example.com | bob@example.com |
| 3 | charlie@example.com | charlie@example.com |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks