Splitter.SplitTextByRepeatedLengths

Updated on

Splitter.SplitTextByRepeatedLengths is a Power Query M function that splits text into a list after the specified length repeatedly. The function returns a list of text segments after applying the repeated length-based splitting.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Splitter.SplitTextByRepeatedLengths(
   length as number,
   optional startAtEnd as nullable logical,
) as function

Description

Returns a function that splits text into a list of text after the specified length repeatedly.

Examples

Repeatedly split the input into chunks of three characters, starting from the beginning of the input.

// Output: {"123", "456", "78"}
Splitter.SplitTextByRepeatedLengths( 3 )( "12345678" )

Repeatedly split the input into chunks of three characters, starting from the end of the input.

// Output: {"87", "654", "321"}
let
    startAtEnd = true
in
    Splitter.SplitTextByRepeatedLengths( 3, startAtEnd )( "87654321" )

Used by

While you can use the Splitter.SplitTextByRepeatedLengths function by itself, it also works together with:

Other functions related to Splitter.SplitTextByRepeatedLengths are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/splitter-splittextbyrepeatedlengths