Text.Range

This function retrieves a portion of the text starting from a specified position called offset. Additionally, users can choose to specify the number of characters to extract by including an optional p...

Syntax

Text.Range(text as nullable text, offset as number, optional count as nullable number) as nullable text

About

This function retrieves a portion of the text starting from a specified position called offset. Additionally, users can choose to specify the number of characters to extract by including an optional parameter called count. If the requested number of characters exceeds the available text, an error will be generated.

Explanation

Identify the part of the text "Hello World" that begins at position 6. Method of Use: In Power Query M, utilize the Text.Range function to extract the substring that starts at position 6 from the text "Hello World". Result: The extracted substring is "World". Identify the part of the text "Hello World Hello" that begins at position 6 and spans 5 characters. Method of Use: In Power Query M, use the Text.Range function to extract the substring that starts at position 6 and includes 5 characters from the text "Hello World Hello". Result: The extracted substring is "World".