==Edit in relation to answers==
Both answers provided give the required result just in separate ways.
@Hannover_Fist's answer displays better but is a little more rigid in its design, it currently works fine for a Saturday to Saturday report, but would need a edit per report if the recurring date span changed
@niktrs answer doesn't display as cleanly, even with a very very small top row, but has a bit more flexibility and does show the latest column compared to the latest minus 1 column with a little more flexability
==Edit in relation to answers==
I have an SSRS matrix that dynamically pulls from a database a list of values. The matrix represents each value as a row with a date stamp period as a different column. The DB table is populated by a stored procedure that runs a number of queries and snapshots this into a static table, on a weekly basis.
The report shows for each line the sum of records for each date stamp, and is ordered so the latest date stamp shows as the most current record. i.e.
Report | 03/04/21 | 27/03/21 | 20/03/2021 |
---|---|---|---|
Report1 | 1000 | 990 | 800 |
Report2 | 100 | 2000 | 2500 |
I'm wanting to add in a calculated column that appears to the left of the matrix element that shows the difference between the latest datestamp and the latest (minus 1) datestamp as below:
Report | Change | 03/04/21 | 27/03/21 | 20/03/2021 |
---|---|---|---|---|
Report1 | +10 | 1000 | 990 | 800 |
Report2 | -1900 | 100 | 2000 | 2500 |
This date stamp column would dynamically change each week, so would be comparing different columns every 7 days i.e.
Week 1 would be 03/04/2021 compared with 27/03/2021
Week 2 would be 10/04/2021 compared with 03/04/2021
Week 3 would be 17/04/2021 compared with 10/04/2021
I've looked at the following options, but these either allow me to look at the first and last column of the matrix, or presume that the groupings are static/remain static for a longer period of time that the 7 days that mine do.
how to subtract adjacent columns in an ssrs matrix
find the difference between two columns in an ssrs matrix
SSRS: Dynamic difference between two columns in MATRIX
I've not been able to find a solution that meets the requirement of comparing dynamic column groups, that change on a regular basis