Skip to content

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

CLASSIFICAR

On this page (10)

Position of the current group among all the visual's groups by the measure (1 = highest). Ties share the same position.

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

Aliases#

Canonical name: CLASSIFICAR. Accepted aliases (case-insensitive): rankx, ranquear.

Syntax#

code
CLASSIFICAR(expr; [arg2]; [arg3])

All arguments are expressions.

Returns#

Number (the position; 1 = highest), or blank.

Null handling#

A group without a measure gets no position (returns blank).

Evaluation context#

Re-evaluates the measure group by group (it needs to know the axis column — it comes from the visual's groupKey).

Differences from DAX#

  • DAX equivalent: RANKX
  • Compatibility: Compatible with DAX
  • Note: Ties share the same position and the next one is skipped (RANKX Skip behavior). Simplified syntax — no table argument.

Examples#

code
CLASSIFICAR(SOMA(receita))

Example with values#

Input: SP=60 vs RJ=40; position of SP.

code
CLASSIFICAR(SOMA(receita))  →  1

Expected result: 1

Business example#

Product ranking by revenue.

Common errors#

CLASSIFICAR: informe a coluna que agrupa o visual … when the axis can't be determined.


← Back to the formula index

Related links