
Extreme DAX
By :

One of the most profound insights when working with DAX is the deep connection between tables and filtering. In this section, you will learn what this connection is, and how to leverage it.
As we discussed earlier in this chapter, table expressions used in table aggregation functions like SUMX
are evaluated in the same context as the table aggregation function itself. This is not always what you want: sometimes, you need a different context. DAX provides a function for precisely this purpose: CALCULATETABLE
.
Like its cousin CALCULATE
, CALCULATETABLE
changes context before evaluating an expression. In CALCULATE
, this expression must return a scalar value; in CALCULATETABLE
, it must be a table expression. Apart from that, the function works with the same four-step process: