Sub topic 4
Expand down versus drill down
This chapter assumes you can build a bar chart or matrix in Power BI Desktop, that you have a hierarchy such as Category > Subcategory > Product or Year > Quarter > Month, and that you know what filter context is. Earlier chapters covered how drill-down moves through a hierarchy. Here you compare it with the expand modes, which look similar but behave differently.
The two ideas in one sentence
Drill down replaces what the visual shows with the next level. Expand down keeps the current level and adds the next level beneath it.
Both use the same hierarchy and the same buttons in the visual header. The difference is what happens to the level you were already looking at.
The header buttons
When a visual has two or more fields in its axis (or rows, for a matrix), the visual header shows a set of drill controls. Hover over the visual to see them.
| Button | Name | What it does |
|---|---|---|
| Up arrow | Drill up | Goes back one level. |
| Down arrow (single) | Drill mode toggle | Turns drill mode on or off. When on, clicking a data point drills into it. |
| Two down arrows (fork) | Go to the next level in the hierarchy | Moves every data point down one level at once. |
| Two down arrows (split) | Expand to the next level | Keeps the current level and adds the next level for all data points. |
The exact icons can change between Power BI versions. If you are unsure, hover over a button and read its tooltip. The names in the table match the wording Power BI uses.
Drill down: replace the level
With drill down, the visual swaps one level for the next.
Suppose a column chart shows Sales by Category. Turn on drill mode and click the Bikes column. The chart now shows Sales by Subcategory, filtered to Bikes only. The Category level is gone from the axis. You see Mountain Bikes, Road Bikes, and so on, but only for Bikes.
If you use "Go to the next level" instead of clicking a data point, the visual drops to Subcategory for all categories. Nothing is filtered to a single category. The axis shows every subcategory in the model.
So there are two variants of drill down:
- Drill mode on, click a data point. The next level appears, filtered to the item you clicked.
- Go to the next level, with no click. The next level appears for everything, with no filter from the parent.
The second variant surprises many readers. It shows the subcategories without telling you which category each belongs to, and two categories could in theory share a subcategory name.
Expand down: keep the level and add the next
Expand down adds the next level while keeping the one you have. In a matrix, the result is a nested row layout. Each Category row has its Subcategory rows under it. In a chart, the axis becomes a combined label such as "Bikes Mountain Bikes", with the parent shown on a second line or in a concatenated label.
Use the "Expand to the next level" button to expand every data point at once. For a single data point, right-click it and choose Expand > Selection. For the whole visual, use the header button or right-click and choose Expand > All.
Three expand choices
Right-click a data point or look at the Expand submenu to see these options.
| Option | Where it applies | Result |
|---|---|---|
| Expand to next level | The whole visual | Every item shows its children. |
| Expand all down one level | The whole visual | The same as above, for a hierarchy with more than two levels. It adds one more level each time you use it. |
| Selection | One data point | Only the selected item shows children. |
The "Selection" option is useful when most of the visual should stay compact. In a matrix, you can right-click only the Bikes row and choose Expand > Selection. Only Bikes shows its subcategories. Clothing and Accessories stay collapsed.
Comparing the two on one example
Take a matrix with Category > Subcategory on the rows and Total Sales as the value. Assume these totals.
| Category | Subcategory | Total Sales |
|---|---|---|
| Bikes | Mountain Bikes | 400 |
| Bikes | Road Bikes | 600 |
| Clothing | Jerseys | 150 |
| Clothing | Shorts | 50 |
The visual behaves like this:
- At the start, it shows Bikes 1,000 and Clothing 200.
- After "Go to the next level" (drill down), it shows only Subcategory rows: Jerseys 150, Mountain Bikes 400, Road Bikes 600, Shorts 50. The category totals are gone.
- After "Expand to the next level" (expand down), it shows Bikes 1,000, with Mountain Bikes 400 and Road Bikes 600 beneath it, then Clothing 200, with Jerseys 150 and Shorts 50 beneath it.
Expand down preserves the subtotals. Drill down does not.
What happens to filter context
Each action changes the filter context of the measures in the visual in a different way.
When you drill down by clicking a data point, the clicked parent becomes a filter on the visual. Measures in that visual are evaluated with Category = Bikes in context. Measures and the visual's values change accordingly.
When you expand down, every cell is still evaluated with its own full set of coordinates. The Mountain Bikes cell has Category = Bikes and Subcategory = Mountain Bikes in context. The Bikes row has only Category = Bikes in context, so it shows a subtotal.
This matters when you write DAX that depends on the level. The ISINSCOPE function reports whether a column is currently a grouping level in the visual. The measure below returns a label for the current level.
Level Label =
IF (
ISINSCOPE ( Product[Product Name] ), "Product",
IF (
ISINSCOPE ( Product[Subcategory] ), "Subcategory",
IF ( ISINSCOPE ( Product[Category] ), "Category", "Total" )
)
)Put this measure in a matrix and use expand down. The Bikes row returns "Category". The Mountain Bikes row returns "Subcategory". The grand total returns "Total". After a drill down to subcategories only, no row returns "Category", because Category is no longer on the visible axis.
Note the order of the tests. The measure checks the deepest level first. A row at Product level also has Subcategory and Category in scope, so testing Category first would label every row "Category".
Drill down and cross-filtering
Drilling changes the visual itself. It does not by itself filter other visuals on the page. Clicking a data point in drill mode drills into that point and does not cross-filter the page.
If you are not in drill mode, clicking a data point selects it and cross-filters other visuals. In that case the visual keeps its current level. This is a common source of confusion. A reader clicks a column expecting a drill and instead sees the rest of the page filter.
Check which mode you are in. In drill mode, the drill button is highlighted (darker background). Click it again to leave drill mode.
Common mistakes
- Using drill down when the reader needs totals. After drill down, the parent level disappears. If readers need to compare a subcategory to its category total, use expand down or a matrix with subtotals.
- Expecting expand down in a visual that does not support it. Expand is available for visuals that use an axis or rows hierarchy, such as column charts, bar charts, and matrices. Visuals without a hierarchy axis do not offer it. A card has no drill controls at all.
- Forgetting that "Go to the next level" ignores parents. The next level shows items from all parents. Use drill mode and click a data point if you need the filtered view.
- Leaving a visual drilled down when saving. Power BI saves the drill state of the visual in the report. A reader who opens the report may find the visual at a lower level and wonder why. Drill up before you save.
- Using expand on a field that is not part of a hierarchy. You can drill and expand with any set of fields in the axis, not only a defined hierarchy. The order of the fields in the field well sets the order of the levels, so check that order.
When to choose which
Choose drill down when the reader is exploring one branch at a time and the parent total is not needed on screen. It gives more room for the lower level. Choose expand down when the reader needs context: the parent value next to its parts, or a compact way to scan several branches.
Charts with many items at the lower level can become crowded after expand down, because the number of labels is the number of parents multiplied by their children. For charts with long hierarchies, drill down is often the more readable choice. For matrices, expand down is the usual choice, since the layout is made for nested rows.
Exercise
A matrix shows Category on the rows with Total Sales. A reader wants each category's total to stay visible and also see its subcategories beneath it. Which action should they use, and which action would remove the category totals from view?
Show answer
They should use Expand down (the "Expand to the next level" button, or right-click and choose Expand > All). Drill down with "Go to the next level" would replace the Category rows with Subcategory rows, so the category totals would no longer be shown.
Exercise
You use the Level Label measure in a matrix. After a reader presses "Go to the next level" once on a Category > Subcategory matrix, what does the measure return on each row, and why?
Show answer
It returns "Subcategory" on each row. Subcategory is the grouping level on the rows, so ISINSCOPE on Product[Subcategory] is true. Category is no longer on the visible axis, so it is not in scope.
Exercise
A reader clicks a column in a bar chart expecting to see subcategories, but the other visuals on the page filter instead. What is the likely cause and the fix?
Show answer
Drill mode is off, so the click acts as a selection and cross-filters the page. Turn on drill mode with the drill button in the visual header, then click the data point.