Number.Log

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

Syntax

Number.Log(
   number as nullable number,
   optional base as nullable number,
) as nullable number

Description

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.

Examples

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:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/number-log

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy