Int64.From is a Power Query M function that converts a given value to a 64-bit integer, applying rounding if necessary. The function returns either a 64-bit integer or null if the given value is null.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Int64.From(
value as any,
optional culture as nullable text,
optional roundingMode as nullable number,
) as nullable number
Description
Returns a 64-bit integer number
value from the given value
. If the given value
is null
, Int64.From
returns null
. If the given value
is number
within the range of 64-bit integer without a fractional part, value
is returned. If it has fractional part, then the number is rounded with the rounding mode specified. The default rounding mode is RoundingMode.ToEven
. If value
is of any other type, it will first be converted to a number
using Number.FromText
. Refer to Number.Round
for the available rounding modes. An optional culture
may also be provided (for example, “en-US”).
Examples
Get the 64-bit integer number
value of "4"
.
// Output: 4
Int64.From( "4" )
Get the 64-bit integer number
value of "4.5"
using RoundingMode.AwayFromZero
.
// Output: 5
Int64.From( "4.5", null, RoundingMode.AwayFromZero )
Related functions
Other functions related to Int64.From are:
- Byte.From
- Currency.From
- Decimal.From
- Double.From
- Int16.From
- Int32.From
- Int8.From
- Number.From
- Number.FromText
- Number.ToText
- Percentage.From
- Single.From
