Int64.From

Number

Converts a value to a 64-bit signed integer (-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807).

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Int64.From(value as any, optional culture as nullable text, optional roundingMode as nullable number) as nullable number

Parameters

NameTypeRequiredDescription
valueanyYesThe value to convert. Accepts number, text, logical, or null.
culturetextNoAn optional culture string for locale-aware parsing of text values.
roundingModenumberNoAn optional rounding mode constant used when truncating fractional values.

Return Value

numberA 64-bit signed integer (long integer).

Remarks

Int64.From converts a value to a signed 64-bit integer — the largest fixed-size integer type in Power Query M, covering approximately ±9.2 × 10^18. This is the type displayed as "Whole Number" in the Power BI Desktop data type menu, making it the standard integer type for most data modeling work. It maps to BIGINT in SQL Server and equivalent 64-bit integer types in other databases.

Use Int64.From for primary key columns, row counts, Unix epoch timestamps (milliseconds), and any integer data where values might exceed the 32-bit range (-2.1B to 2.1B). For the vast majority of integer use cases in Power BI models, Int64.From is the right choice over Int32.From or Int16.From, as the memory overhead difference is rarely significant compared to the risk of overflow.

The default rounding mode is round-half-to-even (banker's rounding), not conventional "round half up." Pass RoundingMode.AwayFromZero for conventional behavior. Note that a 64-bit integer stores up to 19 significant digits, whereas M's default number type (double-precision float) only has ~15–17 significant digits — so for very large integers, converting to Int64.From may lose no precision whereas the double representation would. Text values are parsed numerically; logical true converts to 1, false to 0, and null returns null.

Examples

Example 1: Convert a large integer value

Int64.From(9007199254740992)
Result
Result
19,007,199,254,740,992

Example 2: Parse a large integer from text

Int64.From("1234567890123")
Result
Result
11,234,567,890,123

Example 3: Apply Whole Number type to the OrderID column in Sales

Table.TransformColumnTypes(
    Table.SelectColumns(Table.FirstN(Sales, 4), {"OrderID", "CustomerName"}),
    {{"OrderID", Int64.Type}}
)
Result
OrderID
CustomerName
11Alice
22Bob
33Charlie
44Alice

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks