Sub topic 1
How visuals get their data: filters and interactions
Every number in a Power BI visual is the result of a calculation under a set of filters. Drill-down, drill-through, and tooltips each work by changing or inheriting those filters. This chapter builds the working model so the later features feel predictable.
Prerequisites
This chapter assumes you can:
- Move around Power BI Desktop: Report view, the Fields pane, and the Visualizations pane.
- Build simple visuals such as bar charts, tables, and matrices.
- Read a basic star-schema model, with a fact table such as
Salesrelated to dimension tables such asProduct,Customer, andDate. - Write a simple DAX measure such as
SUMover a column.
The examples use a model with Sales[Sales Amount], Product[Category], Product[Subcategory], Product[Product Name], Customer[Customer Name], and a 'Date' table. All are one-to-many relationships from the dimension to Sales.
What a visual actually calculates
A visual does not store data. When a page loads, each visual sends a query to the model and displays the result. The query has two parts:
- The fields you place in the visual (axis, legend, rows, columns). These decide which groups appear.
- The filters in effect. These decide which rows of the model are allowed to contribute to each group.
Take a measure:
Total Sales = SUM ( Sales[Sales Amount] )Put Product[Category] on the axis of a column chart. Power BI evaluates [Total Sales] once per category. For the "Bikes" column, it first restricts Product to rows where Category = "Bikes". The relationship passes that restriction to Sales, and SUM then adds only the remaining rows. The set of active restrictions during a calculation is called the filter context.
The measure has no idea which visual it sits in. It runs under whatever filter context the visual creates. That is why one measure can produce a different number in every bar, every table cell, and every tooltip.
Where filters come from
Several layers combine to build the filter context. They are cumulative: a row must pass all of them to be counted.
| Source | Scope | How the reader or author sets it |
|---|---|---|
| Report-level filter | Every page | Filters pane, "Filters on all pages" |
| Page-level filter | One page | Filters pane, "Filters on this page" |
| Visual-level filter | One visual | Filters pane, with the visual selected |
| Slicer | Page (or synced pages) | Reader picks values in the slicer |
| Fields in the visual | One visual | Axis, rows, columns, and legend values |
| Selection in another visual | Other visuals on the page | Reader clicks a bar, slice, or row |
| Drill-through filter | The target page | Reader right-clicks a data point and drills through |
Two points follow from this table.
First, the fields in a visual act as filters too. In a matrix with Category on rows and Year on columns, each cell is filtered by one category and one year. A card with no fields has no such filter, so it shows the total under whatever page and report filters apply.
Second, filters narrow and never widen. A page filter for 2025 cannot be loosened by a visual. A visual can only add more restrictions, unless a measure deliberately removes them (covered below).
How filters travel through relationships
Filters flow along relationships. In a star schema, the default direction is from the "one" side (a dimension) to the "many" side (the fact table). Selecting "Bikes" in a Product slicer filters Sales to bike sales. It also filters any other dimension only through Sales, which usually does not happen because the filter does not travel from the fact table back out to other dimensions.
The consequence matters for the features in this tutorial:
- A visual built from
Customer[Customer Name]and[Total Sales]responds to aDateslicer. The filter goesDatetoSales, andCustomergroups are then computed from the filteredSalesrows. - Clicking a bar of
Product[Category]can filter a visual built onCustomer[Customer Name], because the selection reachesSalesand the measure sums only those rows. Customers with no sales in that category show a blank total and may drop out of the visual. - If a relationship is inactive, or its direction does not match what you expect, a filter silently has no effect. Keep this in mind for the troubleshooting chapter.
Visual interactions: cross-filtering and cross-highlighting
When a reader selects a data point in one visual, Power BI applies that selection as a filter to the other visuals on the page. This is the visual interaction. Each target visual responds in one of three ways:
- Filter. The target recalculates with the selection added to its filter context. Only matching data remains.
- Highlight. The target keeps all its original data and draws the matching part in a darker shade over the full-size bar or slice. This is available for chart types that can show a portion of a whole.
- None. The target ignores the selection.
In most reports, selecting a point in a chart highlights other charts and filters tables, matrices, and cards. The behavior depends on the visual types involved.
Highlighting is useful because it shows the share of a selected group against the total. A highlighted bar answers "how much of this category is the selected item?" A filtered bar answers "what does this category look like with only the selected item?"
Changing interactions
You control the behavior per source and target:
- Select the visual that will act as the source.
- On the Format tab of the ribbon, choose Edit interactions.
- Small icons appear above every other visual. Select the Filter, Highlight, or None icon on each target.
- Turn Edit interactions off when you finish.
The setting belongs to the pair. Making a slicer ignore one chart does not change how the slicer affects other visuals, and it does not change how that chart affects others.
Selecting more than one point
Hold Ctrl while clicking to select several points. The selections combine into a single filter on that field. Selecting "Bikes" and "Clothing" in a category chart filters other visuals to rows that are in either category. Selections on different fields, such as one category and one year, are combined with AND.
Measures can change the filter context
Because a measure runs under inherited filters, an author can adjust them. CALCULATE evaluates an expression under a modified filter context. A common pattern is to remove the filter on one column to calculate a share of the total:
Category Share =
DIVIDE (
[Total Sales],
CALCULATE ( [Total Sales], REMOVEFILTERS ( Product[Category] ) )
)In a bar chart by category, the numerator is filtered to the bar's category, and the denominator removes the category filter, so it returns sales for all categories. Other filters, such as a year slicer, still apply to both parts.
This shows why the order of filters matters for what a reader sees:
- The slicer for 2025 narrows both numerator and denominator.
- The category filter from the axis narrows only the numerator.
- Selecting a bar elsewhere on the page narrows both, unless the measure removes that field too.
Measures like this are the foundation for the context-aware measures later in the tutorial, where a measure tests which filters exist and responds to them.
Seeing the flow
The diagram shows how the layers combine for one visual.
Drill-down changes the "fields" input by moving to a lower level of a hierarchy. Drill-through adds a new filter when the reader lands on another page. A tooltip runs a small query using the hovered point's filter context. Every feature in this tutorial is a variation on this one diagram.
Common mistakes at this stage
- Expecting a card to change when you click a chart. If the interaction is set to None, or the card is not built from fields that relate to the clicked field, it keeps its value. Check Edit interactions and the model relationships.
- Confusing highlight with filter. A bar that stays tall with a darker section is highlighted, not filtered. The total is still the full total.
- Forgetting hidden filters. A visual with an unexpected number often has a page or report filter the reader cannot see on the canvas. Open the Filters pane.
- Blaming the measure. The measure is usually correct. The filter context it ran in was different from what you assumed.
Exercises
Exercise
A column chart shows Total Sales by Product[Category]. A table beside it shows Total Sales by Customer[Customer Name]. When you click the "Bikes" column, the table shows only customers who bought bikes, and their totals shrink to bike sales only. Which interaction setting is the table using, and why are the totals smaller than before?
Show answer
The table uses Filter (tables normally filter rather than highlight). The click adds Category = "Bikes" to the filter context. The filter travels from Product to Sales, so each customer's Total Sales sums only their bike rows. Customers with no bike sales have a blank total and drop out.
Exercise
A page has a slicer for Year = 2025. A bar chart by category uses the measure Category Share, defined with CALCULATE and REMOVEFILTERS on Product[Category]. Do the bars sum to 100% of all-time sales or of 2025 sales? Explain.
Show answer
They sum to 100% of 2025 sales. REMOVEFILTERS removes only the filter on Product[Category] in the denominator. The Year slicer filter is still part of the filter context for both numerator and denominator.