Text.Start
The first characters of a text.
Group: Text and characters. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Text.Start(text as nullable text, count as number) as nullable text
| Parameter | Type | Description |
|---|---|---|
text | nullable text | The text to work on; null gives null. |
count | number | How many characters to keep. |
Returns
nullable text. The first characters; the whole text when it is shorter than the count.
Compared with Power Query
Known difference in OpenBI Studio 0.3.79, found while this page was written and run on its engine:
Text.Length(Text.Start("𐐨", 1)): Power Query gives 1: a character beyond the basic range is two UTF-16 units, and it can cut between them, leaving half a character. OpenBI keeps such a character whole and gives 2.
Examples
The country code
Text.Start("NO-0150", 2)
"NO"
A short text
Text.Start("NO", 5)
"NO"
No error: the whole text comes back.