SELECTEDMEASURENAME DAX Function (Information)
Returns name of the measure that is currently being evaluated.
Syntax
This expression has no parameters.
Return values
Returns the name of the measure evaluated.
» 1 related function
Examples
-- Code of the calculation item Growth in the Time calc -- calculation group used in the following example. IF ( SEARCH ( "Pct", SELECTEDMEASURENAME (), 1, -1 ) = -1, VAR CY = SELECTEDMEASURE () VAR PY = CALCULATE ( SELECTEDMEASURE (), SAMEPERIODLASTYEAR ( 'Date'[Date] ) ) VAR Result = CY - PY RETURN Result )
-- SELECTEDMEASURENAME returns the name of the currently selected measure. -- It can be used in place of ISSELECTEDMEASURE to search for specific -- name patterns. DEFINE MEASURE Sales[Sales Amount] = SUMX ( Sales, Sales[Quantity] * Sales[Net Price] ) MEASURE Sales[Sales Quantity] = SUM ( Sales[Quantity] ) EVALUATE SUMMARIZECOLUMNS ( 'Product'[Brand], 'Date'[Calendar Year], 'Time calc'[Time calc], TREATAS ( { "CY 2008" }, 'Date'[Calendar Year] ), TREATAS ( { "Contoso", "Fabrikam" }, 'Product'[Brand] ), "Sales Amount", [Sales Amount], "Quantity", [Sales Quantity], "% of Products", [Pct over all prods] ) ORDER BY 'Product'[Brand], 'Date'[Calendar Year], 'Time calc'[Time calc]
Brand | Calendar Year | Time calc | Sales Amount | Quantity | % of Products |
---|---|---|---|---|---|
Contoso | 2008-01-01 | Current | 2,369,167.68 | 14,901.00 | 54.31% |
Contoso | 2008-01-01 | Growth | -360,650.85 | 429.00 | (Blank) |
Contoso | 2008-01-01 | Growth % | -0.13 | 0.03 | (Blank) |
Contoso | 2008-01-01 | Prev Year | 2,729,818.54 | 14,472.00 | 62.29% |
Fabrikam | 2008-01-01 | Current | 1,993,123.48 | 3,899.00 | 45.69% |
Fabrikam | 2008-01-01 | Growth | 340,372.14 | 701.00 | (Blank) |
Fabrikam | 2008-01-01 | Growth % | 0.21 | 0.22 | (Blank) |
Fabrikam | 2008-01-01 | Prev Year | 1,652,751.34 | 3,198.00 | 37.71% |
Related articles
Learn more about SELECTEDMEASURENAME in the following articles:
-
Introducing Calculation Groups
This article is the first of a series dedicated to calculation groups in DAX. This introduction explains the capabilities of this feature and how to create calculation groups in a Tabular model. » Read more
-
Currency conversion in Power BI reports
This article describes how to implement currency conversion for reporting purposes in Power BI. » Read more
-
Controlling Format Strings in Calculation Groups
This article describes how to control format strings in calculation groups. Before starting, we suggest you read the previous articles in this series. » Read more
-
Scripting syntax for calculation groups
This article introduces the syntax to describe in a textual form the DAX expressions and additional properties of calculation groups. » Read more
Related functions
Other related functions are:
Last update: Dec 4, 2024 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://docs.microsoft.com/en-us/dax/selectedmeasurename-function-dax