BinaryFormat.SignedInteger64

D

T

The M Code Behind the Power Query M function BinaryFormat.SignedInteger64

In this article, we will explore the M code behind the BinaryFormat.SignedInteger64 function and provide examples of how it can be used in Power Query.

Understanding the BinaryFormat.SignedInteger64 function

The BinaryFormat.SignedInteger64 function is used to convert a binary value to a signed 64-bit integer value or vice versa. The syntax for this function is as follows:


BinaryFormat.SignedInteger64(binary as binary, optional endian as nullable number) as number


The binary parameter is a binary value that represents a signed 64-bit integer. The optional endian parameter specifies the byte order of the binary value. If no endian value is specified, the function assumes a little-endian byte order.

The function returns a signed 64-bit integer value.

Example 1: Converting binary data to a signed 64-bit integer

Suppose we have the following binary data:


11010011 01100111 10111100 00001111 00000000 00000000 00000000 00000001


We can use the BinaryFormat.SignedInteger64 function to convert this binary value to a signed 64-bit integer as follows:


let

binaryData = Binary.FromText(“1101001101100111101111000000111100000000000000000000000000000001”, BinaryEncoding.Base2),

signedInt = BinaryFormat.SignedInteger64(binaryData)

in

signedInt


The resulting signed integer value is -7,250,000,063.

Example 2: Converting a signed 64-bit integer to binary data

Suppose we have the signed 64-bit integer value -7,250,000,063. We can use the BinaryFormat.SignedInteger64 function to convert this value to binary data as follows:


let

signedInt = -7250000063,

binaryData = BinaryFormat.SignedInteger64(signedInt)

in

binaryData


The resulting binary value is:


11010011 01100111 10111100 00001111 00000000 00000000 00000000 00000001


The BinaryFormat.SignedInteger64 function is a powerful tool for working with signed 64-bit integers in Power Query. Whether you need to convert binary data to a signed integer or vice versa, this function can help you get the job done quickly and efficiently. By understanding the M code behind this function, you can unleash the full potential of Power Query and take your data manipulation to the next level.

Power Query and M Training Courses by G Com Solutions (0800 998 9248)

Upcoming Courses

Contact Us

    Subject

    Your Name (required)

    Company/Organisation

    Email (required)

    Telephone

    Training Course(s)

    Your Message

    Upload Example Document(s) (Zip multiple files)