What is Filter Context in Power BI?

Cody Schneider••8 min read

Navigating Power BI for the first time often comes with a major hurdle: understanding filter context. It’s one of those core concepts that, once it clicks, changes everything about how you build reports and write formulas. This article will break down exactly what filter context is, how it works, and why mastering it is your ticket to creating powerful, dynamic dashboards.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

What is DAX and Why Context Matters?

Before we dive into filter context, we need to briefly talk about its parent language: DAX. DAX, or Data Analysis Expressions, is the formula language used in Power BI, Excel Power Pivot, and other Microsoft data tools. It looks similar to Excel formulas, but it's far more powerful for data modeling and analysis.

Here's the crucial difference: in Excel, a formula like =SUM(A1:A10) always references those specific cells. The context is fixed. In DAX, a formula like Total Sales = SUM(Sales[Amount]) doesn't produce a single, unchanging number. Its result depends entirely on the "context" it's calculated in.

Asking for "Total Sales" without context is like asking a barista "How much did you sell?" The immediate follow-up would be: "When? Today? This week? And for which drinks? Just lattes? Or everything?" The answers - the date, the drink type - provide the context needed to give a meaningful number. In Power BI, this is exactly what filter context does.

Understanding Filter Context

Filter context is the set of all active filters applied to your data before a DAX measure is calculated. Think of it as a series of stencils placed over your data model. Each slicer, each chart element, and each filter you apply adds another stencil, narrowing down the visible data until only a specific subset remains. Your DAX measure then runs its calculation on that tiny, pre-filtered subset.

This dynamic filtering is happening constantly in a Power BI report. Every single cell in a table or point on a chart has its own unique filter context.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Where does filter context come from?

Filter context isn’t just one thing, it's a combination of filters coming from multiple places in your report. The most common sources include:

  • Rows and Columns: In a table or a matrix visual, the row and column headers act as natural filters. For instance, if you have a table showing sales by country, the cell for "Canada" automatically has a filter applied for "Country = Canada".
  • Slicers: Slicers are the most obvious source of filters. When a user selects "2023" from a year slicer, that becomes part of the filter context for all visuals on the page.
  • The Filters Pane: Any filters you manually drag onto the Filters pane (whether for a specific visual or the entire page) contributes to the filter context.
  • Visual Cross-Filtering: Clicking on a bar in a bar chart can filter other visuals on the same page. That click temporarily adds to the filter context for those visuals.
  • DAX Formulas: Advanced DAX functions, most notably CALCULATE, can create, modify, or remove filter context directly within a formula.

Filter Context in Action: A Simple Example

Theory is great, but let’s see this in practice. Imagine you have a simple sales table with this data:

Sales Table

First, we need a "base measure" to calculate revenue. In DAX, this would look complex in a calculated column, but is simple using a measure. First, we'll create a calculated column for Revenue in the table:

Revenue = Sales[Units Sold] * Sales[Price]

Now, let's create our base measure for total sales:

Total Revenue = SUM(Sales[Revenue])

Step 1: The Initial Context (No Filters)

Drag a Card visual onto your Power BI canvas and add the Total Revenue measure to it. It will display $17,350. Right now, the filter context is "the entire Sales table." There are no slicers or other filters active, so the SUM function looks at every single row in the Revenue column and adds it up. Simple enough.

Initial State: No filters are active. Context: The entire Sales table. Result: $17,350

Step 2: Context from a Table visual

Now, let’s create a Table visual. Drag Region into the columns and our Total Revenue measure into the values.

You’ll see this:

What just happened? Power BI automatically created a different filter context for each row in the visual.

  • For the first row, the filter context became "all rows where Sales[Region] = 'North'". It then calculated our Total Revenue measure within that context. (5 * 1200) + (10 * 75) = $6,750.
  • For the second row, the context changed to "all rows where Sales[Region] = 'South'", resulting in a different total.
  • The Total row at the bottom discards the row-specific filters, reverting to the original context of the entire table.

This is filter context at its most fundamental. The visual itself is generating the filters that change the measure's outcome.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Step 3: Layering Context with a Slicer

Finally, let's add a Slicer visual for the Product column.

If you select "Laptop" in the slicer, everything changes. The Card visual drops to $15,600, and your table now looks like this:

The slicer added an additional filter - Sales[Product] = 'Laptop' - to the overall context. This new filter is now combined with the filters being generated by the table rows.

  • For the Card: The context is simply Sales[Product] = 'Laptop'.
  • For the "North" row in the table: The combined context is now "all rows where Sales[Region] = 'North' AND Sales[Product] = 'Laptop'".

Meet CALCULATE: The Master of Filter Context

Understanding how visuals imply filter context is half the battle. The other half is learning to control that context yourself. The key to this is the CALCULATE function. It is arguably the most important and versatile function in all of DAX.

CALCULATE does two things:

  1. It takes an expression or measure you want to evaluate (like our Total Revenue).
  2. It allows you to modify the filter context before evaluating that expression. You can add new filters, overwrite existing ones, or remove them entirely.

Its basic syntax is:

CALCULATE(<expression>, <filter1>, <filter2>, ...)

Let's use it to solve a common business problem: comparing a segment to the whole. We want to see the total revenue for just Laptops, regardless of what the user selects in the rest of the report.

Here’s the measure:

Laptop Revenue = CALCULATE([Total Revenue], Sales[Product] = "Laptop")

This formula tells Power BI: "Before you calculate Total Revenue, I want you to apply a brand new filter: Sales[Product] must be 'Laptop'. If there's already a filter on the Product column from a slicer or a chart, ignore it and use mine instead."

Now, add this new Laptop Revenue measure to your table visual. Unselect everything in the Product slicer. The table now shows:

Notice how CALCULATE works with the existing context. For the "North" row, the original context was Sales[Region] = 'North'. Our CALCULATE function came in and added another filter (Sales[Product]='Laptop'), resulting in a value of $6,000. It didn't remove the region filter, it added to it.

Being able to add, override, and remove filters with CALCULATE is what allows you to create advanced KPIs like Year-Over-Year growth, percentage of total parent, and comparisons against fixed goals.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Filter Context vs. Row Context (A Quick Clarification)

As you go deeper into DAX, you'll encounter another concept called "row context." It's easy to confuse the two.

  • Row Context exists in calculated columns or within certain "iterator" functions (like SUMX). It asks, "which row am I on right now?" It works row-by-row on a table and doesn’t have a built-in sense of the bigger picture or what might be filtered. Our simple Revenue column earlier used row context (Sales[Units Sold] * Sales[Price]).
  • Filter Context exists for measures in visuals. It asks, "what subset of the data should I look at?" It works on the entire data model after all filters from slicers, visuals, etc., have been applied. Our measures (Total Revenue, Laptop Revenue) used filter context.

Remember this simple distinction: Row context iterates, filter context filters. The magic of DAX happens when these two concepts work together, but for now, focusing on filter context will get you 90% of the way there in your reports.

Final Thoughts

Filter context is the invisible engine that powers Power BI's dynamic visuals. It’s the combination of all the filters from your charts, slicers, and formulas that tells your DAX measures what data to look at before calculating a result. Understanding this flow of context, especially how to control it with CALCULATE, is the most critical skill for leveling up from a beginner to an intermediate Power BI creator.

While mastering concepts like filter context is part of the BI journey, there's often a massive learning curve with tools like Power BI to get even simple answers. In our work, we found that most teams spend hours wrangling data just to answer basic questions. That's why we created Graphed, an AI data analyst that lets you skip the DAX learning curve altogether. You can connect your marketing and sales data, then ask questions in plain English like, "Compare my laptop revenue to my total revenue by region for last quarter," and instantly get live, interactive dashboards - no measure writing required.

Related Articles