Skip to main content
Albero Academy

Filter Context & CALCULATE

The concept that makes DAX powerful — and how to change it.

DAX10 min

Filter context is the single most important DAX concept. A measure doesn't compute one fixed number — it recomputes for the filters applied by each cell of a visual (the row, the slicer, the page filter). CALCULATE is how you change that context.

What is filter context?

Total Sales = SUM(Sales[Amount]) shows the grand total on a card, but per product in a bar chart, and this month under a slicer — same measure, different results, because the surrounding filters differ. That's filter context, applied automatically.

CALCULATE

modify the filter context
Sales (Data prog) =
CALCULATE([Total Sales], Products[Programme] = "Data")
% of Total =
DIVIDE([Total Sales], CALCULATE([Total Sales], ALL(Products)))
-- ALL() removes filters, giving the grand total for the ratio

Key takeaways

  1. 01Filter context: a measure recomputes for the filters applied by each visual cell/slicer/page.
  2. 02The same measure gives different results per row, column and slicer — automatically.
  3. 03CALCULATE(expression, filters) evaluates a measure with a modified filter context.
  4. 04ALL removes filters (e.g. for % of total); mastering context is the key DAX skill.

Finished this chapter?

Mark it complete to track your progress through Power BI.