Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reporting Services - Calculating row totals/percentages in a table

I am trying to calculate totals for each row as well as a percentage of the overall total.

Right now I have a table like this:

Blah    Col1    Col2    Col3
-----------------------------
ABC      1        1      1
DEF      2        2      3
-----------------------------
Total    3        3      4

And I want it to include totals/percentages like so:

Blah    Col1    Col2    Col3    Total    %
--------------------------------------------
ABC      1        1      1        3     30%
DEF      2        2      3        7     70%
--------------------------------------------
Total    3        3      4        10    100%

I know I can do the calculations in the SQL query, but the stored procedure is rather complicated so I'd like to avoid that if possible. So I'm wondering if there's a simple way to achieve this in SSRS.

Right now I just have a row group for each Blah which I use to calculate column totals.

like image 221
tskuzzy Avatar asked Jul 18 '11 15:07

tskuzzy


1 Answers

I added a Totals Row for my matrix, then I referenced the totals textbox (textbox 8 in my case) for the column and I did:

Sum(Fields.FieldName.Value)/ReportItems!Textbox8.Value

I hope this makes sense!

like image 137
Nachatar Dhaliwal Avatar answered Sep 24 '22 14:09

Nachatar Dhaliwal