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
| Parameter | Type | Description |
|---|---|---|
binary | nullable binary | The 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.