Binary.Compress

Updated on

Binary.Compress is a Power Query M function that compresses a binary value using the specified compression type (GZip or Deflate). The function returns a compressed copy of the input binary value.

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

Syntax

Binary.Compress(
   binary as nullable binary,
   compressionType as number,
) as nullable binary

Description

Compresses a binary value using the given compression type. The result of this call is a compressed copy of the input. Compression Types include:

Examples

Compress the binary value.

// Returns #binary({227, 226, 26, 5, 163, 96, 20, 12, 119, 0, 0})
Binary.Compress( Binary.FromList( List.Repeat( {10}, 1000 ) ), Compression.Deflate )

Other functions related to Binary.Compress are:

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