BinaryFormat.Length
This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.
Returns a binary format that limits the amount of data that can be read. Both BinaryFormat.List and BinaryFormat.Binary can be used to read until end of the data. BinaryFormat.Length can be used to limit the number of bytes that are read.
BinaryFormat.Length(binaryFormat as function, length as number) as function
| Argument | Description |
|---|---|
| binaryFormat | The binary format to limit. |
| length | The number of bytes to read |
Limit the number of bytes read to 2 when reading a list of bytes.
let
binaryData = #binary({1, 2, 3}),
listFormat = BinaryFormat.Length(
BinaryFormat.List(BinaryFormat.Byte), 2)
in
listFormat(binaryData)
equals {1, 2}
Show: