The FILTER() function

The FILTER() function is one of the most important and powerful functions in DAX in that it allows complex logic to fully define the set of rows of a table. FILTER() accepts a table as an input and returns a table with each row respecting its defined condition. The FILTER() function is almost always used as a parameter to a CALCULATE() function and can add to the existing filter context or redefine the filter context by invoking ALL() as its table input. The date intelligence measures described later in this chapter utilize FILTER() to fully define the set of Date rows for the filter context.

In the following DAX measure, the FILTER() function is utilized against the Date table and implements a condition based on the ...

Get Mastering Microsoft Power BI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.