Filter Context, Row Context and CALCULATE
Understand it in simple language
Filter context is the set of filters that limits rows used by a measure. Row context is the current row during an iterator or calculated-column evaluation. CALCULATE evaluates an expression in modified filter context; it also performs context transition when a row context exists.
North Revenue = CALCULATE([Revenue], Sales[Region] = "North")
Region Share = DIVIDE([Revenue], CALCULATE([Revenue], REMOVEFILTERS(Sales[Region])))
For this training model the region slicer uses Sales[Region]. If production uses a Region dimension, remove the relevant dimension filter instead. A filter on the same column can be replaced by CALCULATE; KEEPFILTERS asks for intersection.
Do it step by step
Put Sales[Region], Revenue, North Revenue and Region Share in a table. Expect North share 1250/2300 and South share 1050/2300 without other filters. Apply a Product slicer and explain why the denominator still respects product. Browser lab: Investigate filter context.
Check your result
Why can every row of North Revenue show 1250? The measure replaces that column's region filter.
If something goes wrong
Remove only the filters required by the business definition. ALL over an entire fact table can erase more context than intended.
Practice data and learning method
Industry practice collection: downloadable retail, finance, HR and operations datasets, dictionaries, full walkthroughs and answer sheets. The cases contain multiple years, multiple related tables, deliberate data defects and known-answer checks. Progress from the small foundation files below to these cases; do not reuse the foundation totals for the larger datasets.
Download Sales.csv, Products.csv, and the dataset guide. These files contain synthetic training data, not real customers. Use the Power BI virtual labs for guided browser practice. Each lab states its supported operations. Then repeat the procedure above in the actual Microsoft tools and save evidence of your result. Try another filter or an intentionally incorrect setting and explain what changed before moving on.
Guided practicals for this topic
Virtual lab · Microsoft Power BI · 25 min
Investigate filter context
Guided browser practice with visible data, checked actions and expected results. Repeat the linked tutorial in Power BI Desktop.
Virtual lab · Microsoft Power BI · 35 min
Validate year and region filter context
Hands-on retail case: load the downloadable CSV tables, perform the actions, inspect the full-data result and reconcile it. Includes a paired Desktop procedure.
Continue learning from Microsoft
Power BI documentation · DAX reference · Power Query M reference · Power BI analyst skills map. Features, licensing, menus and availability can change; check the relevant official page for your environment.
Practise this topic
Hands-on virtual labs
Apply what you just read in a realistic, guided simulation. Free with a verified account.
Create a free account to track your progress and unlock virtual labs.