MEASURE DAX Statement
The MEASURE keyword introduces a measure definition (DEFINE) in a query (also known as query measure).
The syntax after MEASURE defines a measure, which can be consumed in any other expression of the same query.
A query measure overrides a model measure with the same name. However, its definition is only used in other query measures; other model measures continue to use the model measure definition.
The following example shows using a query measure in multiple parts of a DAX query.
DEFINE
MEASURE Sales[Sales Amount] = SUMX ( Sales, Sales[Quantity] * Sales[Net Price] )
MEASURE Sales[Total Cost] = SUMX ( Sales, Sales[Quantity] * Sales[Unit Cost] )
MEASURE Sales[Margin] = [Sales Amount] - [Total Cost]
EVALUATE
SUMMARIZECOLUMNS (
Customer[CountryRegion],
"Sales Amount", [Sales Amount],
"Margin", [Margin]
)
Last update: Aug 7, 2022 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://docs.microsoft.com/en-us/dax/define-statement-dax
