Pass the monthly value of an SSRS report chart into another report with date from and date to parameters - sql

I have a yearly chart that it broken down into the 12 months Jan - Dec. The report contains various parameters including a yearly dropdown that changes the chart and report.
This all works fine within the first report.
The problem is that I have set up an action on the chart to go to a second report with a monthly breakdown, so my question is how can I pass the monthly value from the first report to the second?
The monthly report has an additional date from and date to parameter, so for the month of January it would need the values: Date From: 01/01/2010 and Date To: 31/01/2010 for example.
Thanks in advance.

Since you have the year and month integer values, you can construct the start and end dates to pass to your other report using expressions.
The start of the month will be:
=DateSerial(Fields!Year.Value, Fields!Month.Value, 1)
Where Year and Month are the integer values from the Chart/Dataset.
The end date is a bit more complicated; since the day part can be 30/31, etc, but we can just add one month to the above expression to get the first of the next month, then go back a day:
=DateAdd(DateInterval.Day
, -1
, DateAdd(DateInterval.Month, 1, DateSerial(Fields!Year.Value, Fields!Month.Value, 1)))
This way your drillthrough report can get its date based parameters and you don't need any changes to your dataset/parent report.

Related

Dynamic date parameters in tableau

How to pass dynamic date parameters in tableau for which one parameter is 2022-01-01 and second parameter changes every quarter last day
Firstly, you should create a Calculation Field that represents END QUARTER. There're different ways, for example:
where DATETRUNC() - the beginning of the current quarter (01/07/2022),
DATEADD('quarter', 1) - obviously add 1 quarter (01/07/2022)
And -1 day to find the of the current quarter.
And when you create a Parameter, you should refer to this Calculated Field:

Using MDX in SSAS tabular get first 10 days of each month

I am trying to dynamically get the dates, starting from begging of month to current date using SSAS Tabular - DAX, I have tried many date functions but I couldn't end up with solution, so is there any idea to share pls ?
The following DAX function will return a table of DATES for each day from the start of the current month through today:
DatesMTD = CALENDAR(DATE(YEAR(TODAY()), MONTH(TODAY()), 1), TODAY())
To be able to filter the dates for the first 10 days, create a calculated column that identifies as a date in this range
1st to 10th Date = If(Day([Date]) <11,1,0)
This can then be used to either filter out the dates past the 10th of each month

SSRS 2016 - Date Range Filter for "This Week"

I am new to SSRS and Report Builder. I run SSRS 2016.
I have a report that is looking at a SharePoint list, the report pulls in the data fine but I need to filter a date field to only show dates from "this week" - as in:
I have a column called "Created Date" and I run the report at 5 pm on the last day of the week (Friday) - The report should only produce all of the items created within the last 5 days (Monday to Friday (including Today, Friday)
I know how to filter on items created today using the =Today() expression, but I have not been able to get anything to work for items created within the last working week.
Any help appreciated.
Thank you.
Personally, I would use 2 Parameters, say #DateFrom and #DateTo. Then you can filter your data to only include data where the Created Date is between #DateFrom and #DateTo.
If the report will always be run on a Friday, and you want Monday to Friday's data, then the expressions for your parameters would respectively be: =DateAdd("d", -5, Today() and =Today().

How do I summarise month to date forecast for current month in Power Pivot?

I have a table in a data model that has forecast figures for the next 3 months. What I want to do is to show what the forecast number for the current month to date is.
When I use the DATESMTD function like this:
=CALCULATE(SUM(InternetSales_USD[SalesAmount_USD]),DATESMTD(DateTime[DateKey]))
I get the last month of my data summarised as a total. I assume that is because the DATESMTD function takes the last date in the column and that is 3 months away.
How do I make sure I get this current month MTD total rather then the end of the calendar? The formula should be clever enough to realise I am in May and want the May MTD not the August MTD.
Any ideas?
The way to do this is to do this:
Forecast_Transaction_MTD:=CALCULATE(sum('ATO Online'[2017 Transaction Forecast]), DATESINPERIOD('ATO Online'[Current Year],TODAY(),-day(TODAY()),day))
the last -day(TODAY()) gets the day number for the current day and subtract it from today's date. So, today is the 25 May. the -day(TODAY())),day)) extracts the day (25) and subtracts it from the current date to get me to the 1 May.
The rest of the formula just adds the total for the dates.

Format date in Values for a Range (Gant) Chart SSRS 2008 R2

I have a date column in which the dates are re-curring every year. I'm only interested in the month really, but I can't just put the month number as the high and low value for the gant chart. Is there any way I can format the column? Any suggestions would be awesome.
The gant chart currently is taking the whole date and is working fine, but like I said it goes out to the next year.
Figured it out. So the DATECOLUMN I had was formated as such:
Example: 2013-01-01 00:00:0.000
In order to put in the GANT(RANGE) CHART in the series property, under values, I formated the Top Value and Low Value as =MONTH(DATECOLUMN) using the expression option.
Then for the Horizontal Axis Properties I set the Interval to 1 and Interval Type to Number. And There you have it Monthly time spans with only the Months 1 - 12 showing.
I must also note that I only had one time recorded. So I just did Top Value as: DATEADD(MM,1,DATECOLUMN) In Order to get the right time span in my dataset Script.
Which date format would u like to display in your chart.
If (month with year) like 'Sep 2013'
use this date format for the same.
SUBSTRING(CONVERT(VARCHAR(11),getutcdate(), 113),4,8)