Binary.From is a Power Query M function that creates a binary value from the given value, such as text, or returns null if the input is null. If the value is of any other type, an error is returned.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Binary.From(
value as any,
optional encoding as nullable number,
) as nullable binary
| Argument | Attribute | Description |
|---|---|---|
| value | The value to turn into a binary value. | |
| encoding | optional | Specifies the BinaryEncoding.Type that determines the encoding type applied to binary data.. By default, if this argument is not specified, the function uses BinaryEncoding.Base64, suitable for base-64 encoding. The alternative option available is BinaryEncoding.Hex, used for hexadecimal encoding. |
Description
Returns a binary value from the given value. If the given value is null, Binary.From returns null. If the given value is binary, value is returned. Values of the following types can be converted to a binary value:
text: Abinaryvalue from the text representation. Refer toBinary.FromTextfor details.
value is of any other type, an error is returned.
Examples
Get the binary value of "1011".
// Output: Binary.FromText( "1011", BinaryEncoding.Base64 )
Binary.From( "1011" )
Related functions
Other functions related to Binary.From are:
2023-2026 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy