11.2ALL and REMOVEFILTERS

You will often need filter modifiers to calculate a share of the total. For the share of New York in the revenue, the New York row has to divide 900,000 by the total of the three cities, 1,700,000. But the filter of the row only lets New York through. Filter modifiers are there, among other things, to bring that total onto the row.

You will often read that ALL “removes the filters.” That is a shortcut. ALL builds a table, and CALCULATE is the one that uses it. Here is what really happens.

11.2.1ALL supplies a table

ALL returns all the values of a column, regardless of any filter. Its result is a table.

ALL( <column> )

Here it expects a column, written with its table, like Customers[City]. It also accepts a whole table, like Customers.

This is a reproduction of the Power BI interface for teaching purposes. It differs from the real interface.

This table of three cities works just like a list typed by hand. In CALCULATE, ALL( Customers[City] ) amounts to writing the filter Customers[City] IN { "New York", "Chicago", "Toronto" }. If a city is added to the model, ALL supplies it at once, while the list typed by hand would miss it.

Placed in a table visual by city, the measure COUNTROWS( ALL( Customers[City] ) ) returns 3 on every row. Even on the New York row, ALL supplies the three cities.

The rest of this lesson is part of izyDAX Pro

You have just read the first section. The next 5, their animations, the exercises and the summary are waiting for you with izyDAX Pro, in a single payment.