Microsoft Office Tutorials and References
In Depth Information
FIguRE 6-28 The Table filter expression cannot reference more than one column in a Boolean expression.
You can overcome this limitation by using a functionally equivalent FILTER syntax writing this
CALCULATE( SUM( Orders[Amount] ),
FILTER( Orders, Orders[Quantity] * 2 < Orders[Price] ) )
In the next section, you see how this technique works. For now, it is enough to say that you
can get around some limitations of the filters in the CALCULATE function by using FILTER,
which returns the rows that are active in the filter context defined by the CALCULATE function.
However, do pay attention to the first parameter passed to the FILTER function included in a
CALCULATE call; we explain why in the next paragraphs.
Until now you have seen how to operate with CALCULATE by replacing existing column filters
on filter context with a new filter, which is not related to the existing filter condition. In fact,
this expression
CALCULATE( SUM( Orders[Amount] ),
OR( Cities[Country] = "Italy", Cities[Country] = "France" ) )
is equivalent to this one:
CALCULATE( SUM( Orders[Amount] ),
FILTER( ALL( Cities[Country] ),
OR( Cities[Country] = "Italy",
Cities[Country] = "France" ) ) )
Search JabSto ::

Custom Search