Skip to content

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

FILTRAR

On this page (10)

Inside CALCULAR: keeps only the rows where the condition is true.

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

Aliases#

Canonical name: FILTRAR. Accepted aliases (case-insensitive): filter.

Syntax#

code
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#

code
CALCULAR(SOMA(receita); FILTRAR(uf = "SP"))

Example with values#

Input: sum of the loja channel only (60), in a loja+site visual.

code
CALCULAR(SOMA(receita); FILTRAR(canal = "loja"))  →  60

Expected 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.


← Back to the formula index

Related links