The request

From Megan Collins, Head of Sales
Your goal
Pick the answer that describes exactly which order lines the Lighting cell's Sales measure adds up.
What Megan gets, and why
The lesson
Every number in a Power BI visual is a measure evaluated under a set of filters. That set is the cell’s filter context. Reading it is the first skill of DAX: before you ask whether a formula is right, ask what the cell is filtering.
Where filters come from
A cell collects filters from everything around it:
- The visual’s own headers. A matrix row for Lighting filters
products[category]to Lighting. A column header (a year across the top) adds its own filter. - Slicers on the page. A Year slicer set to 2025 filters
'Date'[Year]. Unless you edit the interactions, a slicer filters every visual on the page. - The Filters pane. Filters on this visual, on this page and on all pages.
- Cross-filtering. Clicking a bar in another chart filters this one too.
All of these combine with AND. A filter on category and a filter on year don’t compete; the cell keeps only rows that pass both. The Total row is the same measure with every filter except the row header, so it still respects the slicers.
How a filter reaches the numbers
Each filter lands on the table that owns the column, then travels along relationships from the one side to the many side. In the Harbor & Pine model:
productsfiltersorder_items(one product, many order lines).'Date'filtersorders, andordersfiltersorder_items.customersfiltersorders, and through itorder_items.
So a slicer on 'Date'[Year] reaches order_items in two hops. The reverse is not true: with
single-direction relationships, a filter on products does not reach orders. That is why
“orders by category” needs DISTINCTCOUNT(order_items[order_id]) and not COUNTROWS(orders).
Where CALCULATE fits
A measure can change the context it is given. The store’s Sales measure is
Sales = CALCULATE(SUM(order_items[line_total]), orders[status] = "completed")
CALCULATE takes the cell’s filter context, adds a filter on orders[status], and evaluates the
sum there. The rest of this chapter is about that: adding filters, replacing them, and removing them
to compute shares and totals.
In this practice tool and in Power BI Desktop
This page runs a practice DAX engine built for this site, not Power BI. In Power BI Desktop you can see a cell’s filter context for yourself: hover the cell for the tooltip, open the Filters pane on the right to see visual, page and report filters, and use View → Performance analyzer → Copy query to see the exact filters the visual sends. On the Format ribbon, Edit interactions shows which slicers filter which visuals.
Common mistakes
- Forgetting a slicer on another part of the page. It still filters the matrix.
- Assuming filters flow both ways. A product filter doesn’t reach
orders. - Reading the Total as the sum of the rows. It is the measure evaluated again, without the row filter. For a plain SUM they agree; for averages, distinct counts and ratios they usually don’t.
Lantern lit!
Practised: filter contextmatrixslicerrelationshipmeasure
- Solved
- No hints
- First run
