Number.Log10

Number

Returns the base-10 logarithm of a number.

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

Syntax

Number.Log10(number as nullable number) as nullable number

Parameters

NameTypeRequiredDescription
numbernumberYesThe positive number whose base-10 logarithm is computed.

Return Value

numberThe 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 1: Log base 10 of 1000 returns 3

Result
Result
13

Example 2: Log base 10 of 1 returns 0

Result
Result
10

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
)
Result
OrderID
CustomerName
UnitPrice
Magnitude
11Alice251
22Bob501
33Charlie151
44Alice751

Compatibility

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