Calculate Running Total in SSRS Grouped Report

This SSRS article shows how to calculate the running total for a grouped table report using a RunningValue function and group name with an example. To do so, right-click on the Datasets folder to create a new DataSet. 

The below screenshot shows the data set that we use for this example.

Data Set

The Sql query that we used above SSRS example is:

SELECT * FROM Employee 

Calculate Running Total in SSRS Grouped Report

We have designed an Employee sales table report and formatted the font and colors.

Under the Row group section, click the down arrow beside the details and select the add group and parent group. For a regular report, please refer to Calculate the Running Total.

Add Parent Group to a Table

Here, we have chosen the Occupation column as the group by option and clicked Ok. It means the employees will group by their occupation.

Choose The Group By Column

And the report review is.

Table Preview

Right-click the last column, i.e., Sales, and choose the insert column and then the Right option to create a new column on the right side of the sales.

Add a New Column to the Table Report

Name the header column as Running Tot, right-click on the empty cell below it, and choose an expression.

Add header name

The SSRS reporting service has a RunningValue function to calculate the running total of a grouped report that accepts a numeric column, an aggregate function, and the dataset name. Here, we have chosen the Sales Column, sum aggregate function to find the total, and Occupation group.

=RunningValue(Fields!Sales.Value,Sum,"Occupation")
Expression to Calculate Running Total in SSRS Grouped Report

And the final report is.

Calculate Running Total in SSRS Grouped Table Report

If you go to the SSRS report preview now, you can see that the running total was calculated based on the occupation group. Then, for each group, the running total value was restarted by the reporting services.

Calculate Running Total in SSRS Grouped Report Preview

To calculate the running total of a complete table, replace the Occupation group name with the DataSet name, i.e., EmpDataSet.

=RunningValue(Fields!Sales.Value, sum, "EmpDataSet")
New Expression to Calculate Running Total in SSRS Grouped Report

Now you can see the running total of a complete table from top to bottom.

Example of Calculate Running Total in SSRS Grouped Report