OpenBI Docs Buy

SELECTEDMEASURE

In a calculation item's expression: the measure the item is applied to.

Group: Information. Compatible with DAX.

Syntax

SELECTEDMEASURE ( )

It takes no parameters.

Returns

Same as the measure. What the measure that the calculation item stands in for gives, under the filters in force.

Remarks

  • A calculation group's items rewrite measures: when its column is filtered to one item (by a slicer, a visual's grouping or CALCULATE), each measure that is evaluated is replaced by that item's expression, and SELECTEDMEASURE stands for the measure itself.
  • An item Last year written as CALCULATE ( SELECTEDMEASURE (), SAMEPERIODLASTYEAR ( 'Date'[Date] ) ) turns any measure into its value a year earlier; SELECTEDMEASURE () * 2 doubles it.
  • Only measures are rewritten: a column's sum written straight into a query is left as it is.
  • When two or more items of the same group are filtered at once, none is applied: the measure gives its own value.
  • Anywhere else, in a measure, a calculated column or a query, the call is an error.

Examples

Outside a calculation item

The Example Brewery has no calculation group, and a query cannot define one; outside a calculation item the call has nothing to refer to, and is an error.

EVALUATE
ROW ( "Measure", SELECTEDMEASURE () )

Result: an error.

SELECTEDMEASURENAME, ISSELECTEDMEASURE, SELECTEDMEASUREFORMATSTRING, CALCULATE.

Last updated · OpenBI Studio 0.3.74