How does the SELECTEDMEASURENAME function (DAX) work?
The SELECTEDMEASURENAME function (DAX) returns name of the measure that is currently being evaluated.
SELECTEDMEASURENAME Formula Syntax
How do you use the SELECTEDMEASURENAME function?
This function is often used for debugging purposes when authoring calculation groups. Used by expressions for calculation items to determine the measure that is in context by name.
Related Blog Posts
Related Support Forum Posts
Considerations when using the SELECTEDMEASURENAME function
The SELECTEDMEASURENAME function should be considered when the business logic of a calculation item must apply a transformation based on an external configuration. For example, the function might be useful when there is a table with a list of measures that should be enable a behavior in a calculation item so that the model has an external configuration that can be modified without requiring an update of the DAX code.
Related Video Tutorials
Formula examples using the SELECTEDMEASURENAME function
IF ( SELECTEDMEASURENAME = “Expense Ratio”, SELECTEDMEASURE (), DIVIDE ( SELECTEDMEASURE (), COUNTROWS ( DimDate ) ) )
IF ( NOT ( SELECTEDMEASURENAME () = “Margin %” ), DIVIDE ( SELECTEDMEASURE (), COUNTROWS ( ‘Date’ ) ) )