Binary.Range

Updated on

Binary.Range is a Power Query M function that returns a subset of a binary value starting at a specified offset, with an optional maximum length parameter. The function returns the subset of the binary value.

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

Syntax

Binary.Range(
   binary as binary,
   offset as number,
   optional count as nullable number,
) as binary

Description

Returns a subset of the binary value beginning at the offset binary. An optional parameter, offset, sets the maximum length of the subset.

Examples

Returns a subset of the binary value starting at offset 6.

// Output: #binary( {6, 7, 8, 9, 10} )
Binary.Range( #binary( {0..10} ), 6 )

Returns a subset of length 2 from offset 6 of the binary value.

// Output: #binary( {6, 7} )
Binary.Range( #binary( {0..10} ), 6, 2 )

Other functions related to Binary.Range are:

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