Skip to content

Automatic translation — the Portuguese version is the reference. View in Portuguese

SOMAX

On this page (10)

Evaluates the expression for each row and SUMS the results. Accepts a FILTRAR(...) table as the 1st argument.

FieldValue
CategoryContext and filter
TypeAggregation (operates on a set of rows)
Arity1 to 2 arguments
Compiles to SQL (calculated column)No
VersionFormula engine v3.

Aliases#

Canonical name: SOMAX. Accepted aliases (case-insensitive): sumx.

Syntax#

code
SOMAX(expr; [arg2])

All arguments are expressions.

Returns#

Number (sum of the per-row results), or blank.

Null handling#

When there is no row in the changed context, it returns blank (never zero) — a blank is more honest than a made-up zero.

Evaluation context#

Iterator — evaluates the expression ROW BY ROW (the bare column takes each row's value) and aggregates the result. Accepts a virtual FILTRAR(...) table as the 1st argument.

Differences from DAX#

  • DAX equivalent: SUMX
  • Compatibility: DIFFERS from DAX — different semantics, watch out
  • Note: The virtual table in the 1st argument can only be FILTRAR(...); DAX SUMX accepts any table expression.

Examples#

code
SOMAX(quantidade * preco)

Example with values#

Input: rows (q=2, p=10) and (q=3, p=20).

code
SOMAX(q * p)  →  80

Expected result: 80

Business example#

Revenue = sum of quantity × price, row by row.

Common errors#

With two arguments, the 1st MUST be a FILTRAR(...) table — otherwise you get a guided error.


← Back to the formula index

Related links