Number.From
Turns a value into a number: text, a logical, a date or datetime, a time or a duration.
Group: Number. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Number.From(value as any, optional culture as nullable text) as nullable number
| Parameter | Type | Description |
|---|---|---|
value | any | The value to turn into a number. |
culture | nullable text optional | A culture's name, such as "nb-NO" or "de-DE"; the query's culture when left out. |
Returns
nullable number. The number; null for null.
Remarks
- Text is read in the culture given, else the query's (the model's Locale for import, else its own culture, else en-US): in en-US a comma groups thousands and a point marks decimals; a trailing % divides by 100. Text that isn't a number is a DataFormat.Error.
- A date or datetime gives its serial number as spreadsheets count days: whole days since 30 December 1899, the time of day as a fraction.
- A time or a duration gives a number of days: 18:00 is 0.75.
- true is 1 and false is 0.
Number.FromTexttakes text only;Int64.From,Currency.Fromand the others also round to their type.
Examples
Text written the en-US way
Number.From("1,234.5")
1234.5
A datetime as a day number
Number.From(#datetime(2026, 3, 1, 18, 0, 0))
46082.75
A duration in days
Number.From(#duration(1, 6, 0, 0))
1.25
A day and six hours.
Related functions
Number.FromText, Number.ToText, Int64.From, Currency.From, Table.TransformColumnTypes.