Having a way to drill down into your data can be very useful. They're great for when space is at a premium and for reducing cognitive load for the end user. I'm a big fan and I've used it a few times in my client projects at The Data School.
![](https://www.thedataschool.co.uk/content/images/2021/07/image-96.png)
In the above screenshot, I can click on a Product and it will show me a breakdown of how much each Sub-Product contributes.
Let's not waste any time and get straight to the tutorial (I will be using the Superstore dataset included with Tableau):
The picture below is for demo purposes. This is the structure that we want for our drill down. We want to be able to click on a Category and it shows us all of the Sub-Categories inside that Category. If the Category isn't selected then it stays collapsed.
![](https://www.thedataschool.co.uk/content/images/2021/07/image-97.png)
1. Place Category onto the Rows
![](https://www.thedataschool.co.uk/content/images/2021/07/image-105.png)
2. Create a Set from the Category field
![](https://www.thedataschool.co.uk/content/images/2021/07/image-106.png)
![](https://www.thedataschool.co.uk/content/images/2021/07/image-107.png)
3. Create a calculated field called 'Sub-Category Drilldown' and place this onto the Rows
![](https://www.thedataschool.co.uk/content/images/2021/07/image-98.png)
IF [Category Set] THEN [Sub-Category]
ELSE ''
END
![](https://www.thedataschool.co.uk/content/images/2021/07/image-108.png)
4. Create a Set Action by going to 'Worksheet' at the top left of Tableau and clicking on 'Actions...'. Next click on 'Add Actions' in the new window that pops up
![](https://www.thedataschool.co.uk/content/images/2021/07/image-99.png)
5. Name this Set 'Change Category Set Drilldown' and make sure you have 'Remove all values from set' selected at the bottom right of this window
![](https://www.thedataschool.co.uk/content/images/2021/07/image-100.png)
6. Create another calculated field called 'Category Drilldown with Arrow' and place this field onto the Rows
![](https://www.thedataschool.co.uk/content/images/2021/07/image-113.png)
IF [Category Set] THEN '▼ '
ELSE '▶ '
END + [Category]
7. Ensure that Category is to the left of 'Category Drilldown with Arrows' in the Rows. Then right click on Category and click on 'Show Header'
![](https://www.thedataschool.co.uk/content/images/2021/07/image-111.png)
This way you will be able to both drill up and down without the order of Category changing.
![](https://www.thedataschool.co.uk/content/images/2021/07/image-112.png)
8. As an extension, feel free to jazz it up by using 'Hide Field Labels for Rows', using row banding etc.
![](https://www.thedataschool.co.uk/content/images/2021/07/drill-down-1.png)
* chef's kiss *
Socials/Links:
Extra reading:
Link to the Tableau workbook for this blog post