Sub topic 4
Expand down versus drill down
This chapter assumes you can build a matrix or bar chart in Power BI Desktop and that your model has a hierarchy such as Category > Subcategory > Product, or a date hierarchy. It covers the two ways to move down a hierarchy inside one visual, and how they differ.
Two ways to go one level deeper
Both features move from a level such as Category to the next level, Subcategory. They differ in what happens to the rows already on screen.
- Drill down replaces the current level with the next one. The visual shows only the new level, and it is filtered to what you selected (or to everything, if you used the visual-level drill button).
- Expand down keeps the current level and adds the next level beneath it. In a matrix or a table the parent rows stay visible and the child rows appear under them. In a chart, the axis shows the parent and child together.
Drill-up and "collapse" reverse these actions.
The buttons on a visual
A visual with a hierarchy in its axis (or rows) shows controls in its header when you hover over it.
| Control | Action | Result |
|---|---|---|
| Drill up arrow | Go back one level | Returns to the previous level |
| Drill mode (single down arrow) | Turn drill mode on or off | While on, clicking a data point drills into it |
| Go to the next level (double arrow, forked) | Drill all items down one level | Shows the next level for every item, with no filter |
| Expand to the next level (forked arrow) | Expand all items down one level | Shows parent and child levels together |
You can also right-click a single data point and choose Drill down or Expand for that one item only.
How the levels combine
The difference becomes clear when you look at what the visual shows after each action.
In a matrix you have more control. Right-click a row header and choose Expand to next level, Expand entire level, or Expand selection. This produces a layout like this:
| Row | Sales |
|---|---|
| Bikes | 120,000 |
| Mountain Bikes | 70,000 |
| Road Bikes | 50,000 |
| Accessories | 30,000 |
The parent total stays in view next to its children. With drill down, the same matrix would list only Mountain Bikes and Road Bikes, and the Bikes total would disappear from the visual.
Why this matters for measures
The expand and drill actions change which columns are in scope for each cell. A measure that checks the current level, such as the Level Label measure from the spine, returns a different value on parent rows than on child rows when you expand.
Level Label =
IF (
ISINSCOPE ( Product[Product Name] ), "Product",
IF (
ISINSCOPE ( Product[Subcategory] ), "Subcategory",
IF ( ISINSCOPE ( Product[Category] ), "Category", "Total" )
)
)After you expand down from Category, parent rows return "Category" and child rows return "Subcategory". After you drill down, every row returns "Subcategory". Test measures in both modes, because a calculation that works on one level can give a misleading number on another.
Which to use
- Use drill down when the reader wants to focus on one branch and the parent level is no longer needed.
- Use expand down when the reader needs to compare a parent with its children, or see subtotals next to detail.
- In a matrix, prefer expand when you want a layout like a report table. In a chart with limited space, prefer drill down, because a combined axis can become crowded.
Exercise
Exercise
A matrix shows Category rows with Sales. A manager wants to see each Category total and its Subcategory rows together, without leaving the visual. Should you use drill down or expand down, and why?
Show answer
Use expand down. It keeps the Category rows and adds the Subcategory rows beneath them, so the manager sees each total next to its detail. Drill down would replace the Category rows with Subcategory rows and hide the totals.
Exercise
A measure uses ISINSCOPE to return "Subcategory" when the Subcategory column is in scope. After you expand down from Category, what do the parent rows return, and why?
Show answer
Parent rows return "Category". On those rows only the Category column is in scope, and the Subcategory column is in scope only on the child rows.