Text.StartsWith
TextReturns true if a text value starts with a specified substring.
Syntax
Text.StartsWith(text as nullable text, substring as text, optional comparer as nullable function) as nullable logicalParameters
| Name | Type | Required | Description |
|---|---|---|---|
text | text | Yes | The text value to check. |
substring | text | Yes | The substring to match at the beginning. |
comparer | function | No | A comparer function to control case sensitivity. |
Return Value
logical — true if the text starts with the substring, false otherwise.
Remarks
Text.StartsWith checks whether a text value begins with a given substring. Like Text.Contains, the comparison is case-sensitive by default.
Examples
Example 1: Filter log entries by action prefix
Table.SelectColumns(
Table.SelectRows(OrderLog, each Text.StartsWith([Notes], "New order")),
{"LogID", "Action", "Notes"}
)Result
LogID | Action | Notes | |
|---|---|---|---|
| 1 | L001 | Created | New order: Widget A |
| 2 | L003 | Created | New order: Gadget B |
| 3 | L005 | Created | New order: Widget C |
| 4 | L007 | Created | New order: Gadget D |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks