Skip to content

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

VALOR_SELECIONADO

On this page (10)

The column's value when the group has only one; otherwise the given default.

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: VALOR_SELECIONADO. Accepted aliases (case-insensitive): selectedvalue.

Syntax#

code
VALOR_SELECIONADO(coluna; [arg2])

The 1st argument is the name of a column (bare identifier); the others are expressions.

Returns#

The column's single value, or the default.

Null handling#

More than one value (or none) returns the given default.

Evaluation context#

Aggregation — goes through the rows of the visual's current group.

Differences from DAX#

  • DAX equivalent: SELECTEDVALUE
  • Compatibility: Compatible with DAX
  • Note: The column's value when the group has only one; otherwise the default.

Examples#

code
VALOR_SELECIONADO(uf; "Todas")

Example with values#

Input: group with a single uf (SP).

code
VALOR_SELECIONADO(uf; "Todas")  →  "SP"

Expected result: "SP"

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