Two aspects of DAX measures that give them their power are:
- Their calculations are independent of particular data values
- Their calculations can be applied in any filter context
As you start to do more with DAX measures, however, you find that you need to change calculation behavior based on the above 2 situations. Examples are avoiding division by zero and correctly calculating values for contexts where only one value is present in the filter context, respectively. The functions introduced in Chapter 15 (IF(), BLANK(), ISBLANK(), HASONEVALUE(), SWITCH()) help you craft calculations for these types of situations. In addition, the VALUES() function is introduced. VALUES() is interesting because it can return either a single value (scalar) or multiple values (table) depending on context.