Text.EndsWith

Text

Returns true if a text value ends with a specified substring.

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

Syntax

Text.EndsWith(text as nullable text, substring as text, optional comparer as nullable function) as nullable logical

Parameters

NameTypeRequiredDescription
texttextYesThe text value to check.
substringtextYesThe substring to match at the end.
comparerfunctionNoA comparer function to control case sensitivity.

Return Value

logicaltrue if the text ends with the substring, false otherwise.

Remarks

Text.EndsWith checks whether a text value ends with a given substring. Like Text.Contains, the comparison is case-sensitive by default.

Examples

Example 1: Filter log entries ending with "express"

Table.SelectColumns(
    Table.SelectRows(OrderLog, each Text.EndsWith([Notes], "express")),
    {"LogID", "OrderID", "Notes"}
)
Result
LogID
OrderID
Notes
1L0021Shipped via express
2L0084Shipped via express

Compatibility

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