0
votes

I've a column with values for each month of the year.

Then in parameters of my report i would be able to set the month.

SSRS should return this column with values for each month of the year (like if there's no parameter) but the sum at the bottom of this column should return the sum of the value from the beginning of the year to the selected month.

Is it possible?

1

1 Answers

2
votes

Yes. If I'm understanding correctly, you want something like the image below:

Report layout example for conditional sum

Assuming your MonthYear column is a DateTime and your month parameter is an Integer, you can use an expression like the following to conditionally sum the total based on the parameter value:

=Sum(IIf(Month(Fields!MonthYear.Value) <= Parameters!Month.Value, Fields!Value.Value, 0))