Splitter.SplitTextByPositions is a Power Query M function that splits text into a list at each specified position. The function returns a list of text segments after applying the position-based splitting.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Splitter.SplitTextByPositions(
positions as list,
optional startAtEnd as nullable logical,
) as function
Description
Returns a function that splits text into a list of text at each specified position.
Examples
Split the input at the specified positions, starting from the beginning of the input.
// Output: {"ABC", "|", "12345"}
Splitter.SplitTextByPositions( {0, 3, 4} )( "ABC|12345" )
Split the input at the specified positions, starting from the end of the input.
// Output: {"Redmond", "98052"}
let
startAtEnd = true
in
Splitter.SplitTextByPositions( {0, 5}, startAtEnd )( "Redmond98052" )
Used by
While you can use the Splitter.SplitTextByPositions function by itself, it also works together with:
Related functions
Other functions related to Splitter.SplitTextByPositions are:
- Splitter.SplitByNothing
- Splitter.SplitTextByAnyDelimiter
- Splitter.SplitTextByCharacterTransition
- Splitter.SplitTextByDelimiter
- Splitter.SplitTextByEachDelimiter
- Splitter.SplitTextByLengths
- Splitter.SplitTextByRanges
- Splitter.SplitTextByRepeatedLengths
- Splitter.SplitTextByWhitespace
2023-2026 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy