Reputation: 29
I have two main parameters in a Report:
First is to be used to set the month (e.g. Dez 2017), from this Parameter the Report shall set its fromParameter itself (e.g. Dez 2016 in this case).
What is the easiest way to solve this issue? Is there a dateadd formula, calculating backwards from a Parameter?
My first Parameter is set by a formula like this(creating the last month):
('[Date].[Fiscal].[Month].&['+Format(DateAdd("d",-39,now()),'MMM yyyy')+ '] ')
Or do I have to calculate the "fromperiod" first in a query? How could this look like?
In the end the reporst should still be flexible, so changing its 12 month period based on would the user is selecting in the end.
Upvotes: 2
Views: 882
Reputation: 3195
Try this expression for the start date parameter default value to set it 1 year before the the parameter end date.
=DateAdd(DateInterval.Year, -1, Parameters!EndDate.Value)
Or you could do the reverse if you wanted to base it off the parameter start date.
Upvotes: 2