OpenBI Docs Buy

Binary.Length

How many bytes a binary has.

Group: Binary and lines. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Binary.Length(binary as nullable binary) as nullable number
ParameterTypeDescription
binarynullable binaryThe bytes to count.

Returns

nullable number. The number of bytes; null when the binary is null.

Examples

A word in UTF-8

Binary.Length(Text.ToBinary("Oslo"))
4

More bytes than letters

Binary.Length(Text.ToBinary("Smørbrød"))
10

In UTF-8 each ø takes two bytes: eight letters, ten bytes.

Text.Length, Text.ToBinary, Binary.Buffer.

Last updated · OpenBI Studio 0.3.79