Reputation: 13
I have tones of high level visuals in my Paginated report. Now I have a requirement to add 2 more Gauges that 1, return the average of last 3 months and 2, the average of last 35 days. The report has a start date and an end date. That means I have to find a way to make this visuals work irespective of the date range pass though the paramter as other visual should not be affected. I tried using expression in filter to limit data to first 3 months:
The issue with the expression is that it only return data for past 3 months. But what I want is to return 3 months data to date. I want to do same by returning the last 35 days data to date. How do I do this, please?
My expression: =DateAdd("m",-3,Parameters!Date.Value)
Upvotes: 0
Views: 888
Reputation: 21703
Your question is a bit confusing. You said "the issue is that it returns data for the past 3 months, but what I want is to return 3 months data to date". Isn't that the same thing? or do you mean always from the current date?
Anyway, here's a few examples, hopefully one of them is what you want.
To start with your current expression...
This returns the date passed in via the Date
parameter, minus 3 months. So if '2023-01-15' was passed in, this would return '2022-10-15'
=DateAdd("m",-3,Parameters!Date.Value)
The following expression returns the date that was 35 days ago from today
=DateAdd("d", -35, Today())
Hopefully that will be enough for you to work out what expression you need. If not then please edit your question and clarify.
Upvotes: 0