Binary.Decompress
Compressed bytes unpacked: a GZip file or a raw Deflate stream.
Group: Binary and lines. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Binary.Decompress(binary as nullable binary, compressionType as number) as nullable binary
| Parameter | Type | Description |
|---|---|---|
binary | nullable binary | The compressed bytes. |
compressionType | number | Compression.GZip or Compression.Deflate. |
Returns
nullable binary. The bytes as they were before compression; null when the binary is null.
Remarks
- A .gz file has the GZip form; the tables typed in Power BI Desktop's Enter data are Deflate streams written in Base64.
- Bytes that aren't in the form named give an error.
Examples
A GZip file's contents
Text.FromBinary(Binary.Decompress(Binary.FromText("H4sIAAAAAAAC//MvzsnXUXBKLUpPzdNRCCnKz0vJSM3MBQCftoEGFwAAAA=="), Compression.GZip))
"Oslo, Bergen, Trondheim"
A Deflate stream in Base64
Text.FromBinary(Binary.Decompress(Binary.FromText("8y/OyddRcEotSk/N01EIKcrPS8lIzcwFAA=="), Compression.Deflate))
"Oslo, Bergen, Trondheim"
Related functions
Binary.FromText, Text.FromBinary, Json.Document, File.Contents.