Hierarchy and drill down

From category to product, from year to month: with two fields in the rows a matrix becomes expandable. Measures can also tell which level they are calculating on.

In short: several fields in the rows form a hierarchy. The drill buttons switch the level or expand all of them. ISINSCOPE(column) is TRUE when the matrix groups by that column in the current row and helps calculate differently per level.

Before this: Matrix (level 1) and Creating a dashboard.

Try it now

Task Create a matrix that expands from category to product: Product[Category] and below it Product[Product] in the rows, [Total Sales] in the values.

Sales 120 rows, 7 columns
OrderIDOrderDateShipDateProductIDRegionIDQuantityAmount
13 Oct 20266 Oct 20261221798
29 Nov 202519 Nov 20252351145
320 Sep 202627 Sep 2026544596
416 Jun 20252 Jul 20252151145
526 Mar 202631 Mar 20261343596
64 Dec 202510 Dec 2025545745
78 Jul 202526 Jul 2025614196
820 Feb 20251 Mar 202532359.7
99 Dec 202524 Dec 202562298
1012 Aug 202625 Aug 2026212458
117 Sep 202612 Sep 2026542298
122 Mar 202614 Mar 2026623147

Showing the first 12 of 120 rows.

Measures: [Total Sales]

Product 6 rows, 4 columns
ProductIDProductCategoryPrice
1LaptopHardware899
2MonitorHardware229
3MouseAccessories19.9
4KeyboardAccessories39.9
5Office suiteSoftware149
6AntivirusSoftware49
Region 4 rows, 2 columns
RegionIDRegion
1North
2South
3West
4East
Date 730 rows, 4 columns
DateYearMonthMonthName
1 Jan 202520251Jan
2 Jan 202520251Jan
3 Jan 202520251Jan
4 Jan 202520251Jan
5 Jan 202520251Jan
6 Jan 202520251Jan
7 Jan 202520251Jan
8 Jan 202520251Jan
9 Jan 202520251Jan
10 Jan 202520251Jan
11 Jan 202520251Jan
12 Jan 202520251Jan

Showing the first 12 of 730 rows.

The drill buttons

ButtonEffect
Drill downturns the mode on: clicking a value shows its next level
Go to the next levelswitches all values to the next level
Expand all down one levelshows the next level below the current one, both visible
Drill upback to the level above

You can also create a hierarchy in the model: right-click a column, Create hierarchy, and drag more columns into it. One field then puts all levels into the visual.

Which level is this?

An expanded matrix has product rows, category subtotals and the total row. ISINSCOPE tells them apart: in a product row the matrix groups by product and category, in a subtotal only by category, in the total row by nothing. A slicer filters but does not group, so ISINSCOPE is FALSE where ISFILTERED would be TRUE.

Task For a measure to calculate differently per level, it has to know the level. Create the measure "Level": "Product" in the product rows, "Category" in the category subtotals, otherwise "Total".

Sales 120 rows, 7 columns
OrderIDOrderDateShipDateProductIDRegionIDQuantityAmount
13 Oct 20266 Oct 20261221798
29 Nov 202519 Nov 20252351145
320 Sep 202627 Sep 2026544596
416 Jun 20252 Jul 20252151145
526 Mar 202631 Mar 20261343596
64 Dec 202510 Dec 2025545745
78 Jul 202526 Jul 2025614196
820 Feb 20251 Mar 202532359.7
99 Dec 202524 Dec 202562298
1012 Aug 202625 Aug 2026212458
117 Sep 202612 Sep 2026542298
122 Mar 202614 Mar 2026623147

Showing the first 12 of 120 rows.

Measures: [Total Sales]

Product 6 rows, 4 columns
ProductIDProductCategoryPrice
1LaptopHardware899
2MonitorHardware229
3MouseAccessories19.9
4KeyboardAccessories39.9
5Office suiteSoftware149
6AntivirusSoftware49
Region 4 rows, 2 columns
RegionIDRegion
1North
2South
3West
4East
Date 730 rows, 4 columns
DateYearMonthMonthName
1 Jan 202520251Jan
2 Jan 202520251Jan
3 Jan 202520251Jan
4 Jan 202520251Jan
5 Jan 202520251Jan
6 Jan 202520251Jan
7 Jan 202520251Jan
8 Jan 202520251Jan
9 Jan 202520251Jan
10 Jan 202520251Jan
11 Jan 202520251Jan
12 Jan 202520251Jan

Showing the first 12 of 730 rows.

This exercise is part of Premium.

Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.

See Premium Already Premium? Log in

The first exercise in this lesson is free.

Share within the level above

Task Create the measure "Share in Category": each product's share of its category's sales. The subtotals and the total row should stay blank.

Sales 120 rows, 7 columns
OrderIDOrderDateShipDateProductIDRegionIDQuantityAmount
13 Oct 20266 Oct 20261221798
29 Nov 202519 Nov 20252351145
320 Sep 202627 Sep 2026544596
416 Jun 20252 Jul 20252151145
526 Mar 202631 Mar 20261343596
64 Dec 202510 Dec 2025545745
78 Jul 202526 Jul 2025614196
820 Feb 20251 Mar 202532359.7
99 Dec 202524 Dec 202562298
1012 Aug 202625 Aug 2026212458
117 Sep 202612 Sep 2026542298
122 Mar 202614 Mar 2026623147

Showing the first 12 of 120 rows.

Measures: [Total Sales]

Product 6 rows, 4 columns
ProductIDProductCategoryPrice
1LaptopHardware899
2MonitorHardware229
3MouseAccessories19.9
4KeyboardAccessories39.9
5Office suiteSoftware149
6AntivirusSoftware49
Region 4 rows, 2 columns
RegionIDRegion
1North
2South
3West
4East
Date 730 rows, 4 columns
DateYearMonthMonthName
1 Jan 202520251Jan
2 Jan 202520251Jan
3 Jan 202520251Jan
4 Jan 202520251Jan
5 Jan 202520251Jan
6 Jan 202520251Jan
7 Jan 202520251Jan
8 Jan 202520251Jan
9 Jan 202520251Jan
10 Jan 202520251Jan
11 Jan 202520251Jan
12 Jan 202520251Jan

Showing the first 12 of 730 rows.

This exercise is part of Premium.

Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.

See Premium Already Premium? Log in

The first exercise in this lesson is free.

In real Power BI

  1. Create a matrix with category and product in the rows.
  2. Use Expand all down one level above the visual to show the products under the categories.
  3. Under Format, row subtotals, choose whether subtotals appear.

Common mistakes

ISFILTERED instead of ISINSCOPE

With a slicer on the product, ISFILTERED would be TRUE in the subtotals too. ISINSCOPE asks about the row's grouping and is therefore the right choice for levels.

Wrong order

In a product row the category is grouped too. If you test ISINSCOPE(category) first, you never reach the product level.

FAQ

Is drill through the same as drill down?

No. Drill down stays in the visual and shows a deeper level; drill through jumps to another report page, filtered to the selected value.

Up next: KPI visual and targets

Targets as measures, status symbols and the KPI visual.

Next lesson

Write to us

Choose language

Select your preferred language