OpenBI Docs Buy

GEOMEANX

The geometric mean of an expression over a table's rows.

Group: Statistics. Compatible with DAX.

Syntax

GEOMEANX ( <table>, <expression> )
ParameterTypeDescription
tableTableThe rows to go through.
expressionExpression
evaluated for each row
The number worked out for each row.

Returns

Number. The geometric mean of the expression's results, blanks left out.

Remarks

  • Its common use is the mean growth rate: GEOMEANX ( table, 1 + [Return] ) − 1.
  • Blank results are left out; a zero result makes the answer 0.
  • Negative results are taken as an odd root takes them; with an even number of results whose product is negative, the answer is NaN.
  • Text, dates and TRUE/FALSE are errors. Over an empty table the result is BLANK.

Examples

Mean yearly return over three years

EVALUATE
VAR Returns =
    DATATABLE (
        "Year", INTEGER, "Return", DOUBLE,
        { { 2023, 0.12 }, { 2024, -0.05 }, { 2025, 0.08 } }
    )
RETURN
    ROW ( "Mean yearly return", GEOMEANX ( Returns, 1 + [Return] ) - 1 )
Mean yearly return
0.047422248222325

Lower than the arithmetic mean

EVALUATE
VAR Growth = DATATABLE ( "Factor", DOUBLE, { { 1.10 }, { 0.95 }, { 1.20 } } )
RETURN
    ROW (
        "Geometric", GEOMEANX ( Growth, [Factor] ),
        "Arithmetic", AVERAGEX ( Growth, [Factor] )
    )
GeometricArithmetic
1.078365153390941.08333333333333

Blanks, zeros and negatives

EVALUATE
ROW (
    "With a blank", GEOMEANX ( DATATABLE ( "v", DOUBLE, { { 2 }, { BLANK () }, { 8 } } ), [v] ),
    "With a zero", GEOMEANX ( DATATABLE ( "v", DOUBLE, { { 2 }, { 0 }, { 8 } } ), [v] ),
    "One negative", GEOMEANX ( DATATABLE ( "v", DOUBLE, { { 2.5 }, { 3.5 }, { -1 } } ), [v] )
)
With a blankWith a zeroOne negative
40-2.06064264990428

GEOMEAN, AVERAGEX, PRODUCTX.

Last updated · OpenBI Studio 0.3.74