OpenBI Docs Buy

LOG

A number's logarithm, base 10 unless a base is given.

Group: Math. Compatible with DAX.

Syntax

LOG ( <number> [, <base>] )
ParameterTypeDescription
numberNumberA number above 0.
baseNumber
optional
The base: above 0 and not 1. 10 when left out.

Returns

Number. The power the base must be raised to in order to give the number.

Remarks

  • 0 and negative numbers are errors; so is a base of 0, 1 or below 0.
  • A blank number gives minus infinity (-Infinity), or plus infinity for a base below 1.
  • In base 10 the result is exact for powers of ten: LOG ( 1000 ) is 3, where LN ( 1000 ) / LN ( 10 ) is a hair off.
  • LOG ( x, EXP ( 1 ) ) is LN ( x ); LOG ( x ) is LOG10 ( x ).

Examples

Different bases

EVALUATE
ROW (
    "Of 100", LOG ( 100 ),
    "8 in base 2", LOG ( 8, 2 ),
    "81 in base 3", LOG ( 81, 3 ),
    "8 in base 0.5", LOG ( 8, 0.5 )
)
Of 1008 in base 281 in base 38 in base 0.5
234-3

Exact powers of ten

EVALUATE
ROW (
    "LOG", LOG ( 1000 ) = 3,
    "LN over LN", LN ( 1000 ) / LN ( 10 ) = 3
)
LOGLN over LN
TRUEFALSE

LOG10, LN, EXP, POWER.

Last updated · OpenBI Studio 0.3.74