I have been struggling to compare column values in a SSRS matrix (pivot table), but finally found a way around it.
My solution is rather simple, but it works.
Here is a simple example of the Matrix:
Example | M1 | M2 | M3 |
Cust 1 | 10 | 15 | 10 |
Cust 2 | 13 | 12 | 15 |
Cust 3 | 20 | 22 | 27 |
For example, I would like to compare the M2 value with M1 (15 vs 10) etc.
Example | M1 | d1 | M2 | d2 | M3 | d3 |
Cust 1 | 10 | 0 | 15 | 5 | 10 | -5 |
Cust 2 | 13 | 0 | 12 | -1 | 15 | 3 |
Cust 3 | 20 | 0 | 22 | 2 | 27 | 5 |
My initial thought was to use the ‘Previous’ function, but that did not seem to work, as it showed the previous ROW instead of COLUMN value.
However, you can add a group name to the function (it is not documented in Visual Studio, but it works) where you add the Column group name like so:
=Previous(Sum(Fields!RegBedrHJ.Value),”Per3″)
This way you get the previous value from a column and can compare the two.
Is “Per3” the column group name in your example?
I tried with a group name i have and it is not resolving.
[rsInvalidAggregateScope] The Value expression for the textrun ‘Textbox59.Paragraphs[0].TextRuns[0]’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a dataset.
Just as I wrote : Column group name.
The error shows you have a not entered a valid name.