Text.Start is a Power Query M function that retrieves the first specified number of characters from a text value. The function returns a text value containing the extracted characters.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Text.Start(
text as nullable text,
count as number,
) as nullable text
Description
Returns the first count
characters of text
as a text value.It allows you to specify the desired number of characters to extract from the beginning of a text string.
Examples
Let’s explore some examples to better understand the usage of the Text.Start function:
Suppose you have the text string “Hello, World” and you want to extract the first 5 characters. By using the Text.Start function with the text “Hello, World” and a count of 5, you will obtain “Hello” as the result.
Text.Start( "Hello, World", 5 )
Consider the phrase “Life is good.” If you want to extract the first 4 characters, you can utilize the Text.Start function with the text “Life is good” and a count of 4. This will yield “Life” as the extracted substring.
Text.Start( "Life is good", 4 ) // Returns "Life"
In some cases, you may need to extract a longer substring from the beginning of a text value. For instance, if you have the text “Life is good” and want to retrieve the first 7 characters, Text.Start with the text “Life is good” and a count of 7 will give you “Life is” as the result.
Text.Start( "Life is good", 7 ) // Returns "Life is"
Related articles
Learn more about Text.Start in the following articles:
- Text Functions in Power Query M (150+ Examples)
Your guide to Text Functions in Power Query M. Learn from practical examples and master Power Query’s most useful Text functions. » Read more
Related functions
Other functions related to Text.Start are:
2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy