Updated on

Number.Log is a Power Query M function that calculates the logarithm of a given number to a specified base, with the default base being Number.E. The function returns the logarithm value or null if the input number is null.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365


   number as nullable number,
   optional base as nullable number,
) as nullable number


Returns the logarithm of a number, number, to the specified base base. If base is not specified, the default value is Number.E. If number is null Number.Log returns null.


Get the base 10 logarithm of 2.

// Output: 0.3010299956639812
Number.Log( 2, 10 )

Get the base e logarithm of 2.

// Output: 0.69314718055994529
Number.Log( 2 )

Other functions related to Number.Log are:

BI Gorilla Youtube Channel

Contribute » | Contributors: Rick de Groot
Microsoft documentation: