#binary
A binary value written out in a query, from a list of byte values.
Group: Binary and lines. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
#binary(value as any) as any
| Parameter | Type | Description |
|---|---|---|
value | any | A list of numbers from 0 to 255, one per byte, or the bytes written as a Base64 text. |
Returns
any. The bytes as a binary value.
Remarks
- Handy for small test data: a few bytes to feed
Text.FromBinary,Lines.FromBinaryorBinary.Lengthwithout a file. - A Base64 text must be whole, padding included: "T3Nsbw" without its == is an error.
Compared with Power Query
Known difference in OpenBI Studio 0.3.79, found while this page was written and run on its engine:
(try #binary({256}))[HasError]: Power Query gives false: it reads the list only when the bytes are used, and the error comes then. OpenBI reads the list at once, sotrycatches the error here and gives true; the message is the same.
Examples
Four bytes
#binary({79, 115, 108, 111})
#binary({79, 115, 108, 111})
Bytes in hexadecimal, read as text
Text.FromBinary(#binary({0x4F, 0x73, 0x6C, 0x6F}))
"Oslo"
The same bytes from Base64
#binary("T3Nsbw==")
#binary({79, 115, 108, 111})