Number.Log10
NumberReturns the base-10 logarithm of a number.
Syntax
Number.Log10(number as nullable number) as nullable numberParameters
| Name | Type | Required | Description |
|---|---|---|---|
number | number | Yes | The positive number whose base-10 logarithm is computed. |
Return Value
number — The base-10 logarithm of the number.
Remarks
Number.Log10 returns the common (base-10) logarithm of a number. It is equivalent to Number.Log(number, 10) but is a dedicated shortcut function. The result represents the power to which 10 must be raised to produce the given number — Number.Log10(1000) = 3 because 10³ = 1000, Number.Log10(1) = 0 because 10⁰ = 1.
The input must be a strictly positive number. Passing 0 returns negative infinity; passing a negative number returns NaN. Filter or guard data accordingly when applying this to table columns that might contain zeros or negatives.
Base-10 logarithms are intuitive for humans because they correspond to the number of digits minus 1 in a positive integer. Common uses in data transformation: decibel calculations (dB = 10 × log10(power_ratio)), pH measurements, order-of-magnitude bucketing, and creating log-scale axes or normalization in visuals. For natural log (base e) use Number.Ln; for base 2 use Number.Log(x, 2).
Examples
Example 3: Compute order-of-magnitude bucket for each unit price
Table.AddColumn(
Table.SelectColumns(Table.FirstN(Sales, 4), {"OrderID", "CustomerName", "UnitPrice"}),
"Magnitude",
each Number.RoundDown(Number.Log10([UnitPrice])),
type number
)OrderID | CustomerName | UnitPrice | Magnitude | |
|---|---|---|---|---|
| 1 | 1 | Alice | 25 | 1 |
| 2 | 2 | Bob | 50 | 1 |
| 3 | 3 | Charlie | 15 | 1 |
| 4 | 4 | Alice | 75 | 1 |