Search code examples
reporting-servicesssrs-2008-r2

SSRS Expression to Get last 12 months


I have created a ssrs report and this report display last 12 months data. I have 2 parameters startDate and Enddate. The End date is always the current month and I want the start date to be the last 12 months. For example if my (End Date) current month is JAN 2018. I want my start date to be Feb 2017. I have below expression but this give me Jan 2017 date for my start date.

=DateAdd("M", -12,Today())


Solution

  • Try this expression for the start date parameter default value.

    =DateAdd(DateInterval.Year, -1, DateAdd(DateInterval.Month, 1, Parameters!EndDate.Value))
    

    Here's what the parameter values would equal:

    enter image description here