Sub topic 5
What drill-through does
Drill-through lets a report reader right-click a data point and jump to another page. That page is filtered to the item they clicked. This chapter explains what drill-through is, how it relates to filter context, and where it behaves differently from drill-down. The next chapter builds a drill-through page step by step.
This chapter assumes you can build bar charts, tables, and matrices in Power BI Desktop. It also assumes you have a star-schema model with a date table and can read simple DAX measures.
The core idea
A report page usually shows a summary, such as sales by customer. A reader who sees an unusual number often wants to know what is behind it. Drill-through answers that question. The reader right-clicks the customer, chooses Drill through, and picks a destination page. Power BI opens that page with a filter on that customer.
The destination page is an ordinary report page with one extra setting. That setting lists one or more drill-through fields. When a reader drills through from a data point that includes one of those fields, Power BI passes the value as a filter to the destination page.
Drill-through does not change the source visual. It also does not move through a hierarchy. It switches pages and carries a filter with it.
How the filter is passed
Every visual on a page is calculated within a filter context. Filter context is the set of filters that apply when a measure is evaluated. It comes from slicers, page and report filters, the axis and legend fields of the visual, and other visuals that cross-filter it.
When you drill through, Power BI takes the filters that identify the clicked data point. It applies them to the destination page as a drill-through filter. Every visual on the destination page that is related to that field then recalculates inside the new filter context.
For example, suppose a bar chart shows Total Sales by Customer Name, and the reader drills through from the bar for "Contoso". The destination page receives the filter Customer[Customer Name] = "Contoso". A table of orders on that page now shows only Contoso's orders. A card showing Total Sales shows only Contoso's sales.
What the destination page receives
The filter passed to the destination page depends on the data point. Two points matter.
- Only drill-through fields are passed as drill-through filters. If the destination page lists
Customer[Customer Name]and the source visual contains that field, the value is passed. A drill-through option appears only when the clicked data point includes at least one of the destination's drill-through fields. - Other filters can come along, depending on settings. By default, Power BI passes the drill-through field values. The Keep all filters setting also passes other filters from the source, such as slicer selections. The chapter on drill-through options covers it.
Because the destination page has a filter from the click, a measure on that page can read it. The SELECTEDVALUE function returns the single value left in a column, or a fallback value when there is not exactly one. This measure builds a page title that names the customer:
Drill-through Title =
"Orders for " & SELECTEDVALUE ( Customer[Customer Name], "multiple customers" )After drilling through from Contoso, the title reads "Orders for Contoso". If a reader opens the page directly, with no filter on the customer, the fallback text appears and the title reads "Orders for multiple customers".
Drill-through compared with drill-down
Both features help a reader move from summary to detail. They work differently.
| Aspect | Drill-down | Drill-through |
|---|---|---|
| Where the detail appears | In the same visual | On a different page |
| What changes | The fields the visual shows, such as Year to Quarter | The page and its filter |
| Requires | A hierarchy, or several fields in the axis well | A destination page with drill-through fields |
| What the reader sees next | The same chart at a lower level | A page designed for one item |
| Typical question | What makes up this total? | Tell me everything about this item. |
Drill-down changes the grain of one visual. Drill-through changes the context of an entire page. A drill-through page can hold many visuals of different types, each showing a different view of the selected item. A drill-down visual can show only one view.
Drill-through compared with cross-filtering
Cross-filtering and cross-highlighting also pass a selection to other visuals. They differ from drill-through in three ways.
- Cross-filtering acts on visuals on the same page. Drill-through acts on a different page.
- Cross-filtering depends on a click on the visual, and the selection disappears when the reader clicks away. A drill-through filter stays on the destination page until the reader leaves it.
- Cross-filtering is automatic for visuals on the same page. Drill-through works only where you have set up a destination page.
A destination page is therefore the right place for detail that needs its own layout, such as a customer profile with a table, a trend line, and a map.
Where a reader can start a drill-through
A reader can start a drill-through from a data point in a visual. Examples include a bar in a bar chart, a point on a line, a cell in a table or matrix, or a slice of a pie chart. The reader right-clicks the data point and opens the Drill through submenu. Each destination page whose drill-through fields match the data point appears as an entry.
Several rules affect what appears.
- The submenu lists a destination page only if the clicked point carries a matching field. A bar showing Sales by Product Category does not offer a page whose only drill-through field is Customer Name.
- A visual that does not contain the field in its axis, legend, or rows cannot start the drill-through, even if the field exists in the model.
- Multiple destination pages can all appear. The reader picks one, so give each page a clear name.
- A total row or a data point that represents several values can still drill through. The destination page then receives all the selected values, so
SELECTEDVALUEreturns its fallback.
Multiple values and multiple fields
A drill-through page can list more than one field. Suppose a page lists both Customer[Customer Name] and Product[Category]. A reader can start the drill-through from a visual that has either field. If the source data point has both, the page receives both as filters.
If you select several data points before drilling through, the destination receives several values for the same field. The filter becomes "customer is one of these". This case is common when a reader uses Ctrl-click to pick several bars. A title measure built with SELECTEDVALUE returns its fallback text here, which is why the fallback matters.
By default, multiple drill-through fields are combined with AND. A destination page with two fields filters by both when both are present. Within one field, selected values are combined with OR.
Behavior to expect on the destination page
- The filters appear in the Filters pane for the page, in the drill-through section. Readers see what the page is filtered by.
- The page is usually hidden from the page tabs so that readers reach it only through drill-through. You control this in the page settings, and the next chapter shows how.
- Power BI adds a Back button automatically in Power BI Desktop only when you create one, so plan for navigation. The chapter on back buttons covers this.
- Measures on the destination page do not need special code. They respond to the incoming filter like any other filter context.
Common misunderstandings
- "Drill-through is a visual setting." The setting lives on the destination page, not on the source visual.
- "Any field can be used." The field must be in the source visual and listed as a drill-through field on the destination.
- "The destination page shows only a total." The destination page shows whatever you design. The filter applies to every related visual.
- "Drill-through always passes every filter." By default it passes the drill-through field values. Other source filters pass only if Keep all filters is on.
- "The filter works on any column." The destination visuals must be related to the filtered column through the model. A visual that uses an unrelated table is not filtered.
Exercise
A bar chart shows Total Sales by Product Category. A destination page lists only Customer[Customer Name] as its drill-through field. A reader right-clicks a bar and finds no Drill through option for this page. Why, and how can you fix it?
Show answer
The clicked data point does not include Customer Name, so the destination page does not match. Fix it by using a visual that includes Customer Name in its axis, rows, or legend. You can also add Product[Category] as a second drill-through field on the destination page, so the bar chart can start the drill-through.
Exercise
A destination page has the title measure "Orders for " & SELECTEDVALUE ( Customer[Customer Name], "multiple customers" ). A reader Ctrl-clicks three customers and drills through. What does the title show, and what filter do the visuals receive?
Show answer
The title shows "Orders for multiple customers", because three values remain in the filter and SELECTEDVALUE returns its fallback. The visuals receive a filter that includes all three customers, so they show combined data for those three.