Splitter.SplitTextByRepeatedLengths

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 the Splitter.SplitTextByRepeatedLengths function can be used on its own, it is also used by the following functions:

Other functions related to Splitter.SplitTextByRepeatedLengths are:

BI Gorilla Blog

Last update: November 17, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/splitter-splittextbyrepeatedlengths
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.