Add Total and Subtotal to SSRS Report

In this article, we will show you how to Add Total and Subtotal to SSRS Report. It’s one of the standard requirements from the Client end while you are designing the Table or a Matrix report.

To explain the steps involved to add Total and Subtotal to SSRS Report, We are going to use the below-shown DataSet. Please refer to Embedded Data Source and Dataset articles to understand the steps involved in creating Embedded Data Source and Dataset that we used for this report.

Data Source and DataSet

And the Custom SQL query that we used in the above Dataset is:

-- Add Total to SSRS Report
SELECT [FirstName] +  ' ' + [LastName] AS FullName
      ,[Education]
      ,[Occupation]
      ,[YearlyIncome]
      ,[Sales]
      ,[HireDate]
  FROM [Employee]

Data written by the above query is:

Source Table

Add Total and Subtotal to SSRS Report

SSRS provides you two different approaches to add totals or subtotals to the reports. In this example, we will explain one approach, and later we will explain the other.

To add totals and subtotal, we need a table or matrix report in SSRS. We are going to use the below-shown report for this example.

Please refer to Table ReportFormat Table, and refer to Grouping in Table Report article for Grouping techniques.

Sample Table Report

Let me show you the Report Preview. If you see the below screenshot, it is displaying the data in three levels: Occupation is at Top Level, then Education at Second Level, and Details (Full Name, Hire date, Income, Sales) at third level. Here our task is to add Totals to Both Incomes and Sales Column at all levels.

Table Preview 2

Add Total and Subtotal to SSRS Report: Approach 1

First, we will add the Total at the Details level. To do so first, goto Row Groups pane and right-click on the Details will open the context menu.

From the context, Please select Add Total and then select the After option. It will add the new Row after the Details row, and add Total at Details level

Add Total to a Table Report 4

Let me change the Background color of the total column to Light Steel Blue

Change Background color of subtotals in a Report 5

Let me open the Preview tab to check the Totals at the level of the detail. From the below screenshot, you can see that an extra column added with subtotals in SSRS.

Add Total and SubTotal to a Report 6

Next, we will add the Total at the Education Level (Second Level). To do so first, goto Row Groups pane and right-click on the Education will open the context menu.

From the context, Please select Add Total and then select the After option. It adds the new Row after the Education level, and add Total at Education level

Add Total to a Report After two columns 7

Let me change the Background color of the total column to Pale Turquoise. It differentiates the Totals at Details Level and Education Level

Change Add Total and SubTotal to a Report Color

Let me open the Preview tab to check the Totals at the Education level.

Add Total and SubTotal to a Report Preview 9

Lastly, we will add the Total at the Occupation (Top Level). To do so first, goto Row Groups pane and right-click on the Occupation will open the context menu.

From the context, Please select Add Total and then select the After option. It adds a new Row at the End of the Table, and add the Grand Total at Occupation level

Add Grand Total to a Report 10

Let me change the Background colour of the total column to Plum

Change background color of a report grand total

Let me open the Preview tab to check the Grand Totals at the level of the detail. From the below image, see that an extra column added at the End with Grand Total.

View Grand Total and SubTotal to a Report 12

Add Total and Subtotal to SSRS Report: Approach 2

First, we will add the Total at the Details level. To do so, goto Metric Column (Yearly Income) and right-click on it and select Add Total option. It adds a new Row after the Details row, and add Total at Details level

Add Total and SubTotal to a Report 13

Apply the same technique to the Sales Amount Column. Next, Let me change the Background color of the total column to Pale Turquoise

Add Total and SubTotal to a Report 14

Let me open the Preview tab to check the Totals at the details level. Now, you can see that an extra column added with subtotals.

Add Total and SubTotal to a Report Preview 15

Next, we will add the Total at the Education level. For this, goto Yearly Income Total Column (Details Total Row -> Yearly Income Column) and right-click on it and select Add Total option.

Add Total and SubTotal to a Report 16

Apply the same technique to the Sales Amount Column, and change the Background color to plum

Change Report Total Background Color

Let me open the Preview tab to check the Totals at the Education level.

Add Total and SubTotal to a Report 18

Lastly, we will add the Total at the Occupation Level, or Grand Total. To do so first, goto the Yearly Income Total Column (Education Level Total Row -> Yearly Income Column), and right-click on it will open the context menu.

From the context, Please select the Add Total option as shown in the below screenshot.

Add Grand Total to a Report 19

Let me apply the same technique to the Sales Amount column, and change the Background Color

Add Grand Total, Total,  and SubTotal to a SSRS Report 20

Let me open the Preview tab to check the Grand Totals at the details level. Now, you see that an extra column added at the End with Grand Total in SSRS.

View Grand Total and SubTotal to a Report 21

From the above screenshot, you can see that the second approach is also showing the Grand Total.