Evaluates the expression for each row and takes the AVERAGE. Accepts a FILTRAR(...) table as the 1st argument.
| Field | Value |
|---|---|
| Category | Context and filter |
| Type | Aggregation (operates on a set of rows) |
| Arity | 1 to 2 arguments |
| Compiles to SQL (calculated column) | No |
| Version | Formula engine v3. |
Aliases#
Canonical name: MEDIAX. Accepted aliases (case-insensitive): averagex.
Syntax#
MEDIAX(expr; [arg2])All arguments are expressions.
Returns#
Number (average 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: AVERAGEX
- Compatibility: DIFFERS from DAX — different semantics, watch out
- Note: The virtual table in the 1st argument can only be FILTRAR(...).
Examples#
MEDIAX(receita / pedidos)Example with values#
Input: rows (q=2, p=10) and (q=3, p=20).
MEDIAX(q * p) → 40Expected result: 40
Business example#
Comparative measure — share of total, ranking, change versus another period.
Common errors#
With two arguments, the 1st MUST be a FILTRAR(...) table — otherwise you get a guided error.