SSRS calculates the percentage of a column based on the total row amount

I have a dataset that looks like

+------------+-----------------------------+
| user_name  |             role            |
+------------+-----------------------------+
| User A     |  Admin, System              |
| User B     |  Editor, Power User, System |
+------------+-----------------------------+

I would like to calculate the total number of each column (A, B) as a percentage of the total rows, to look like

+-------+-----+-----+-------+
| Month |  A  |  B  | TOTAL |
+-------+-----+-----+-------+
| Jan   | 90% | 10% | 100%  |
| Feb   | 90% | 10% | 100%  |
| Mar   | 75% | 25% | 100%  |
+-------+-----+-----+-------+

I tried using a table and a can not matrix to work:

enter image description here

+4
source share
1 answer

Your% value expression should look something like this:

=Sum(Fields!Income.Value) / Sum(Fields!Income.Value, "RowGroupName")

Where RowGroupNameis the name of your particular group of strings Month, as you can see in the example above.

This refers to the amount Incomefor a particular group Fee_To/ Monthto all Fee_Tocommon Incomevalues ​​in that group Month.

+9

Source: https://habr.com/ru/post/1530287/


All Articles