BinaryFormat.Transform

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

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