Sub topic 1
How visuals get their data: filters and interactions
Every drill, drill-through, and tooltip feature in Power BI depends on one idea: filter context. This chapter explains how a visual decides which rows to summarize, and how your clicks change that decision. The later chapters on hierarchies, drill-through pages, and tooltips build on it.
Prerequisites
This chapter assumes you can already do the following:
- Move around Power BI Desktop: Report view, the Fields pane, and the Visualizations pane.
- Build simple visuals such as bar charts, tables, and matrices.
- Work with a star-schema model that has a date table.
- Read and write a simple DAX measure such as
SUMover a column.
What filter context is
Filter context is the set of filters that apply to a calculation at the moment it runs. A measure such as [Total Sales] has no fixed answer. Each visual cell asks it a different question, and filter context supplies the question.
Filters reach a visual from several places:
| Source | Example | Scope |
|---|---|---|
| Row, column, or axis fields | `Product[Category]` on a bar chart axis | The one visual |
| Slicers | A year slicer set to 2025 | Visuals on the page that the slicer affects |
| Filters pane | A page-level filter on `Region` | Visual, page, or all pages |
| Other visuals | Selecting a bar in another chart | Other visuals on the page, through interactions |
| Drill-through | Arriving at a detail page for one customer | The target page |
Power BI combines all of these filters with AND logic. A cell in a bar chart for "Bikes" in a report filtered to 2025 shows sales where the category is Bikes and the year is 2025.
How a filter reaches a measure
Filters on a dimension table flow down relationships to the fact table. In a star schema, a filter on Product[Category] limits the rows in Sales, and the measure then summarizes only those rows. This is why the model shape matters. Without a working relationship, a selection in one table cannot change the numbers from another.
Visual interactions
When you select a data point in one visual, the other visuals on the page react. This is called cross-filtering or cross-highlighting. Two behaviors exist:
- Filter: the other visual shows only the data that matches the selection.
- Highlight: the other visual keeps all its data but dims the part that does not match. The matching portion stays bright, so you can compare it to the whole.
Column and bar charts usually highlight. Tables, matrices, and cards filter. You can change this per pair of visuals.
- Select the visual that will act as the source.
- On the ribbon, choose Format, then Edit interactions.
- Above each other visual, an icon row appears. Pick Filter, Highlight, or None.
Setting None cuts the link, so selections in the source no longer change that visual. This is a common cause of "my visual ignores my click" reports, and it returns in the troubleshooting chapter.
Seeing context in a measure
A measure can read the filter context it runs in. This DAX shows the selected category, or a fallback when more than one is in context:
Selected Category =
SELECTEDVALUE ( Product[Category], "Multiple categories" )Put this measure in a card and click different bars. The card changes as the filter context changes. Later chapters use the same idea to title a drill-through page and to adapt tooltips.
Exercise
A bar chart shows sales by category. You click the "Bikes" bar, and a table on the same page still lists all categories, with no change. Name two possible causes.
Show answer
First, the interaction from the bar chart to the table may be set to None in Edit interactions. Second, there may be no relationship between the table that holds the fields in the bar chart and the table that holds the fields in the second visual, so the filter cannot flow to it. (A visual set to Highlight would also dim part of its data rather than hide it.)
Exercise
A page has a year slicer set to 2025 and a bar chart with Category on the axis. How is the value for the "Bikes" bar determined?
Show answer
Power BI applies both filters together with AND logic. The measure summarizes only Sales rows where Category is Bikes and Year is 2025.