Baji
Baji

Reputation: 23

ssrs sum group totals for specific groups and subtract for specific groups

I have a report like this:

Expenses SSRS report

I have grouped on group name called expense type. Ideally expense type has three types, 1, 2 and 3. I have used them to sum up in TOTAL in blue line.

Now I want to add the total of totals to brown tan line,

I want ( (total of group 1 + total of group 3 ) - total of group 2 ) in the tan color total billing submitted.

Can anyone help me in writing this expression?

Upvotes: 1

Views: 4753

Answers (2)

Pete Rennard-Cumming
Pete Rennard-Cumming

Reputation: 1618

Use IIF() or SWITCH() to check the Category of each value before you calculate the totals.

=(Sum(IIF(Fields!ExpenseCategory.Value = "Group 1", Fields!Amount.Value, nothing))
+ Sum(IIF(Fields!ExpenseCategory.Value = "Group 3", Fields!Amount.Value, nothing)) )
/ Sum(IIF(Fields!ExpenseCategory.Value = "Group 2", Fields!Amount.Value, nothing))

Upvotes: 2

Harry
Harry

Reputation: 2941

You can use report items to achieve what you want

for example..

=(Reportitems!group1total.value +Reportitems!group3total.value )-Reportitems!group2total.value 

The above assumes that the property name for the group boxes are group1total, group2total and group3total

Upvotes: 0

Related Questions