BinaryFormat.Text
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 reads a text value. The optional encoding value specifies the encoding of the text.
BinaryFormat.Text(length as number, optional encoding as nullable number) as function
| Argument | Description |
|---|---|
| length | The number of bytes to decode. |
| optional encoding | The encoding of the text. |
If the encoding is not specified, then the encoding is determined from the Unicode byte order marks.
If no byte order marks are present, then TextEncoding.Utf8 is used.
// Decode two bytes as ASCII text.
let
binaryData = #binary({65, 66, 67}),
textFormat = BinaryFormat.Text(2, TextEncoding.Ascii)
in
textFormat(binaryData)
equals "AB"
Show: