SSRS Multi Group Drill Down Table With Totals

This SSRS article shows how to create a Multi group drill down table report with examples of subtotals and grand totals. It is effortless to design multiple grouping and drill down actions using a report wizard, but there is a workaround to create it manually. 

Right-Click on the Datasets folder to create a new DataSet. The screenshot below shows our data set for this SSRS Multi level grouping drill down table report example.

DataSet

The Sql query that we used above SSRS example is:

SELECT Cat.[EnglishProductCategoryName] AS Category, 
       SubCat.[EnglishProductSubcategoryName] AS SubCategory, 
       Prod.EnglishProductName AS ProductName, 
       Prod.Color, 
       SUM(Fact.OrderQuantity) AS Orders, 
       SUM(Fact.TotalProductCost) AS ProductCost, 
       SUM(Fact.SalesAmount) AS Sales, 
       SUM(Fact.TaxAmt) AS Tax
FROM FactInternetSales AS Fact
   INNER JOIN DimProduct AS Prod ON Fact.ProductKey = Prod.ProductKey
   INNER JOIN DimProductSubcategory AS SubCat ON Prod.ProductSubcategoryKey = SubCat.ProductSubcategoryKey 
   INNER JOIN DimProductCategory AS Cat ON SubCat.ProductCategoryKey = Cat.ProductCategoryKey
GROUP BY Cat.[EnglishProductCategoryName], SubCat.[EnglishProductSubcategoryName],
		Prod.EnglishProductName, Prod.Color

Create SSRS Multi Group Drill Down Table With Totals

We have designed a product sales table report and formatted the font and colors.

To create the SSRS Multi group drill down table report with totals, we need a group by column. So, under the Row group, click the down arrow beside the details and select add group and parent group.

Add Parent Group to Table

Let me choose the group by option as a subcategory column. Next, checkmark Add group header option to add an extra empty row (Stepped) beside each subcategory.

Select Subcategory Group By Column

Right-click on the orders and choose the Add total option to add subtotals. Do the same for the Product cost and sales columns. 

Add Subtotals to SSRS Multi Level Grouping Drill Down Table Report

Next, right-click empty columns below the product name and color and choose the Merge Cells option to combine them.

Merge Cells

Select the subtotals cell and go to its properties to change the Row background color.

Add Background Color of Subtotals to SSRS Multi Level Grouping Drill Down Table Report

To add the SSRS Multi-Level grouping drill down table report with totals, click the down arrow beside the SubCategory and select add group and parent group.

Add Another parent Group

Select the category as a group by option, and checkmark Add group header option.

Select Category Group By Column

To get the Category level total, right-click on the Sum of orders column and choose to add the total option. Then, do the same for the Product cost and sales columns. 

Add Second Subtotals to SSRS Multi Level Grouping Drill Down Table Report

Change the background color. Next, right-click the empty columns to Merge those cells.

Add Subtotals with Background color to SSRS Multi Level Grouping Drill Down Table Report

To add the grand total, right-click on the Category level totals and select Add total option.

Add Grand totals to SSRS Multi Level Grouping Drill Down Table Report

Change the background color to Gold. 

Add Grand totals background color to SSRS Multi Level Grouping Drill Down Table Report

Merge the Empty cells at Category and Subcategory levels.

Merge empty cells

Drill Down Action 

Go to the Details section and choose Group Properties. 

Details Group Properties

Click the Visibility tab, and select the Hide option to hide the full details row when the report initially runs. Next, checkmark the Display can be toggled by this report and select SubCategory from the available list.

Set Visibility Toggled By Column

Next, go to the group properties of the subcategory.

Subcategory Group Properties

Under the Visibility tab, select the Hide option to hide the Subcategory row. Next, checkmark the Display can be toggled by this report and select Category.

Display can be toggled by Category

In the SSRS report preview, you can see a stepped Multi-level grouped table report with drill down the action, subtotals for each product category, and grand total.

In the report preview, you can see a little plus button beside each sub-category, and it also displays the subtotals for each product subcategory.

SSRS Multi Group Drill Down Table Report With subtotals and grand Totals Preview

Click the plus button to view the sub-categories and expand another plus to see the detailed report of that particular subcategory.

Expand SSRS Multi Group Drill Down Table Report With subtotals and grand Totals

If you are uncomfortable with extra empty row cells besides the Category and sub-category, right-click and select the delete rows option.

Delete Empty Cells

Let me show you the SSRS Multi Group Drill Down Table With Totals report preview again. Again, it looks much cleaner than the previous one because there is no empty row.

Preview of SSRS Multi Level Grouping Drill Down Table Report

Let me expand a few categories and sub-categories to see the subtotals and grand total.

SSRS Multi Level Grouping Drill Down Table Report with subtotals and grand totals Preview