Create SSRS Drill Down Table Report with Totals

This SSRS article shows how to create a drill down table report with subtotals and grand totals with an example. It is effortless to design using a report wizard, but there is a workaround to create a drilldown report manually. 

Right-Click on the Datasets folder to create a new DataSet. The screenshot below shows the data set we use for SSRS Drill Down Table Report with Totals 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

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

Simple Table report

How to Create SSRS Drill Down Table Report with Totals?

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

Add Parent Group

Let me choose the subcategory column as the group by option and checkmark Add group header option. The Add group header option will add an empty row beside each subcategory.

Add Subcategory as the Group by column

Select all the empty columns and select the Merge Cells option.

Merge Empty Cells

Right-click on the orders cell and choose the Add total option to get the SSRS Drill Down Table Report subtotals.

Add Subtotals to SSRS Drill Down Table Report

Do the same for the Product cost and sales columns. Next, Merge the empty columns below the product name and color by right-clicking and choosing the Merge Cells option.

Merge Empty Cells in subtotals

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

Change Subtotals Background color in SSRS Drill Down Table Report

To get the grand total, right-click on the Sales subtotal column and choose to add the total option. Then, do the same for the orders and Product Cost columns.

Add Grand totals to SSRS Drill Down Table Report

Select the SSRS Drill Down Table Report grand total row and change its background color. And also, right-click on empty columns to choose merge cells.

Change Background color of a Grand totals in SSRS Drill Down Table Report

Apply DrillDown

Go to the Details section, Group Properties.

Go to Group Properties

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

Change the Visibility to toggle

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

SSRS Drill Down Table Report Preview

Click the plus button to view the detailed report of that particular sub-category.

Expand SSRS Drill Down Table Report to view subtotals and grand total

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

Remove Empty row

As you can see, there is no empty row about the details.

Final SSRS Drill Down Table Report

Let me expand a few sub-categories and go to the end of the last page to see the subtotals and grand total. 

SSRS Drill Down Table Report with Totals Preview

Let me show you the SSRS Drill Down Table Report with the Totals preview again. Again, it looks much cleaner than the previous one.

You can see the block grouped drill down table report with subtotals and grand totals.

SSRS Drill Down Table Report with Subtotals and Grand Totals Preview