03.1A measure is filtered by the visual

You know Excel formulas. A measure looks like them, but it does not live in a cell, and that is what makes it so useful when filters come into play. Before going further, here is what sets them apart.

An Excel formula is written in a cell. With dynamic arrays, its result can fill several neighboring cells, but the formula stays written in its starting cell.

A DAX measure is written in no cell at all. It belongs to the whole report, and every page can use it, in a visual, in another measure, in the title of a visual, in a color, as a filter on a visual or in a tooltip.

So the measure is versatile. The same formula is used everywhere, and Power BI calculates it each time with the filters that apply where it is placed.

03.1.1An Excel formula lives in its cell

In Excel, a formula sits in its cell. Here is the total of the sales, written below the column of amounts:

=SUM(G2:G13)

It adds up cells G2 to G13, and only those. Excel calls them its precedents, the cells its result depends on.

In general, an Excel formula always gives the same result as long as its precedents do not change. If you filter the rows to see only customer C001, SUM still shows 1,700,000, because it also adds up the hidden rows. A few Excel tools do follow the filters, though:

  • The SUBTOTAL function, which adds up only the visible rows. With the filter on C001, it gives 450,000.
  • The Excel table. Its “Total” row uses SUBTOTAL, and you can filter it with a , a list where you tick a city or a year.
  • The PivotTable, where every value is recalculated as soon as you tick a slicer.

With SUM, the total for C001 takes a second formula, in another cell:

=SUMIF(C2:C13,"C001",G2:G13)

It gives 450,000. One question, one formula. For the 7 customers, you need seven of them.

A Power BI measure works like the values of a PivotTable, but in every visual on the page at once.

03.1.2A measure changes with the filters

A measure, for its part, refers to no cell. You write it only once, then you place it in a table by city:

Revenue = SUM( Sales[Amount] )
Power BI accepts this DAX foryes, Measureyes, Calculated columnno, Calculated tableno, Virtual table

Placed alone in a card, it returns 1,700,000. Placed in a table, next to the City column, it returns one result per city:

Table visual, The “Revenue” measure by city
CityRevenue
New York900,000
Chicago500,000
Toronto300,000
Total1,700,000

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

The formula has not changed. On the New York row, Power BI only gives it the sales made in New York. The row of the table filters the sales that SUM adds up.

This filter is not the only one. A measure is filtered by a whole series of filters at once, which come from more or less far away:

Internal filters

They come from the visual where the measure is placed.

  • Rows and columns: each row of the table keeps only the sales of its city.
  • Axis and legend: in a chart, each bar and each color has its own filters.
  • Filters on this visual: set in the Filters pane, they only affect this visual.

External filters

They come from the rest of the page.

  • Slicers: you tick 2025, and the visuals on the page follow.
  • Cross-filtering: a click on the New York bar filters the other visuals.
  • Filters on this page: set in the Filters pane, they affect every visual on the page.
  • Drillthrough: a right-click on New York opens another page, already filtered on New York.

Global filters

They affect every page of the report.

  • Filters on all pages: set in the Filters pane, they affect the whole report.
  • Synced slicers: the same date slicer acts on several pages.
  • Row-level security: each person who views the report only sees the rows they are allowed to see, for example the sales of their city.

Formula filters

They come from the formula written in the measure.

  • CALCULATE: this function adds, replaces or removes filters before running the calculation. You will see it later.

All these filters add up. With a date slicer set to the year 2025, the same table gives:

Year

2024

2025

Table visual, The “Revenue” measure by city, in 2025
CityRevenue
New York500,000
Chicago300,000
Toronto150,000
Total950,000

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

Each row now keeps only the sales of its city made in 2025.

All the filters applied to a measure are called the . It will get its own step.

03.1.3Cross-filtering

On a Power BI page, the visuals talk to each other. Click the New York bar in a chart, and the other visuals on the page only show New York. That is cross-filtering.

The card that shows the “Revenue” measure then goes from 1,700,000 to 900,000, without anyone touching its formula. The click puts a filter on the city New York on the other visuals. Power BI recalculates the measure with this filter, and SUM only adds up the sales from New York. Another click on the bar takes the filter away.

Depending on the visual, the click either filters or only highlights the share of New York. You set this behavior visual by visual, with the Format tab, then the Edit interactions button.

Quiz

The questions often rely on the course tables. Keep them in view in their floating window, which you can move and enlarge.

Question 1

In Excel, the formula =SUM(G2:G13) adds up the column of amounts of the 12 sales. You filter the rows to see only customer C001. What does the formula show?

Question 2

A table by “City” shows the measure Revenue = SUM( Sales[Amount] ). A “Year” slicer keeps 2024. What does the New York row show?

Question 3

A page has a card that shows the “Revenue” measure, a chart by city, and a “Year” slicer set to 2025. You click the Toronto bar. What does the card show?

Key takeaways
  • In general, an Excel formula depends only on its precedents, the cells it refers to.
  • A measure is written once. Its result changes with the filters applied to it, those of the visual, those of the page and those of the whole report.
  • A click on a visual filters the other visuals on the page. That is cross-filtering.