PRODUCTX
Evaluates an expression on every row of a table and multiplies the results together.
Group: Aggregation. Compatible with DAX.
Syntax
PRODUCTX ( <table>, <expression> )
| Parameter | Type | Description |
|---|---|---|
table | Table | The rows to go through. |
expression | Expression evaluated for each row | The number worked out for each row. |
Returns
Number. The expression's results multiplied together, blanks left out.
Remarks
- Over an empty table, or when every result is blank, the answer is BLANK.
- Its common use is compounding: multiply 1 + each period's return, then subtract 1 for the total return.
Examples
A return compounded over three periods
+5 %, −2 % and +3 % compound to just under +6 %.
EVALUATE
VAR Returns = DATATABLE ( "Return", DOUBLE, { { 0.05 }, { -0.02 }, { 0.03 } } )
RETURN
ROW ( "Total return", PRODUCTX ( Returns, 1 + [Return] ) - 1 )
| Total return |
|---|
| 0.0598699999999999 |