The column's value when the group has only one; otherwise the given default.
| 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: VALOR_SELECIONADO. Accepted aliases (case-insensitive): selectedvalue.
Syntax#
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#
VALOR_SELECIONADO(uf; "Todas")Example with values#
Input: group with a single uf (SP).
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.