So far, we've looked at quite a few examples of DAX expressions, but we haven't looked in detail at the structure of a typical DAX expression.
Let's set that straight by breaking down a typical DAX expression. For this one, we will define a measure that will give us the total sum of values in the Sales Quantity column of the Sales table, for products in the Deluxe class:
1 Deluxe Sales Quantity
2 =
3 CALCULATE
4 (
5 [Sum of Sales Quantity Measure]
6 ,
7 'Product'[Class]
8 = "Deluxe"
9 )
This DAX expression can be broken down as follows:
- We start with the name we want to give to the measure, which in this case is Deluxe Sales Quantity.
- The equals sign operator (=) defines the start of the DAX formula. When writing DAX expressions with Excel Power Pivot and SSAS Tabular, the equals sign will have a colon before it (:=).
- Our measure...