BinaryFormat.Transform

Updated on

BinaryFormat.Transform is a Power Query M function that transforms values read by another binary format. It takes a binaryFormat parameter and a function that is invoked with the value read, returning the transformed value.

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

Syntax

BinaryFormat.Transform(
   binaryFormat as function,
   function as function,
) as function

Description

Returns a binary format that will transform the values read by another binary format. The binaryFormat parameter specifies the binary format that will be used to read the value. The function is invoked with the value read, and returns the transformed value.

Examples

Read a byte and add one to it.

// Output: 2
let
    binaryData = #binary( {1} ),
    transformFormat = BinaryFormat.Transform( 
        BinaryFormat.Byte,
        ( x ) => x + 1
     )
in
    transformFormat( binaryData )
BI Gorilla Youtube Channel

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