Inside CALCULAR: keeps only the rows where the condition is true.
| Field | Value |
|---|---|
| Category | Context and filter |
| Type | Aggregation (operates on a set of rows) |
| Arity | 1 argument (fixed) |
| Compiles to SQL (calculated column) | No |
| Version | Formula engine v3. |
Aliases#
Canonical name: FILTRAR. Accepted aliases (case-insensitive): filter.
Syntax#
FILTRAR(expr)All arguments are expressions.
Returns#
Modifier/virtual table (does not return a value on its own).
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#
CALCULAR modifier (narrows the context) OR the virtual table in an iterator's 1st argument. Receives the raw nodes (lazy evaluation).
Differences from DAX#
- DAX equivalent: FILTER
- Compatibility: DIFFERS from DAX — different semantics, watch out
- Note: Takes only a boolean CONDITION (not table + condition). Used as a CALCULAR modifier or as the 1st argument (virtual table) of an iterator.
Examples#
CALCULAR(SOMA(receita); FILTRAR(uf = "SP"))Example with values#
Input: sum of the loja channel only (60), in a loja+site visual.
CALCULAR(SOMA(receita); FILTRAR(canal = "loja")) → 60Expected result: 60
Business example#
Comparative measure — share of total, ranking, change versus another period.
Common errors#
Typos in a column name, an incompatible type, or an invalid argument become a friendly message (pt-BR) — the engine never silently returns a wrong number.