Isolating expressions into independent and interchangeable DAX measures or as variables within measures is recommended to simplify development and to maintain version control. Independent measures can be hidden from the Fields list yet contain core business definitions and efficient filtering logic to drive the results and performance of many other measures in the model. Although scoped to each measure, DAX variables provide a self-documenting coding style and, unlike scalar-valued measures, also support table values thus allowing for even greater modularity.
In this recipe, DAX variables, measures, and comments are used in two separate examples. The first example provides a variable-driven approach to the Reseller Margin % measure described in Chapter 3, Building a Power BI Data Model. The second example leverages three table-valued variables...