none
DATESYTD : Only constant date value is allowed as a year end date argument

    Question

  • Hello All,

    I was trying to generate a YTD Report for sales with previous year comparison. We are following a Fiscal calendar. So it is necessity to use the second parameter of DATESYTD to pass the fiscal year end date.

    But it seems like DATESYTD accepts only constant date as second parameter, like "12-01" or "06-01".

    The problem here is we have a whole set of fiscal years with different end date, so when i try to pass a measure or do a switch case it is giving me the following error.

    =CALCULATE (
    SUM (Customers[quantity]),
    DATESYTD (DimDate[Date], SWITCH([fiscal_year],
    2007,"12-30",
    2008,"12-28",
    2009,"12-27",
    2010,"12-26",
    2011,"12-25",
    2012,"12-30",
    2013,"12-29",
    2014,"12-28",
    2015,"12-27"
    )),
    ALL (DimDate)
    )
    

    Only constant date value is allowed as a year end date argument.

    The above mentioned fiscal year is used as a slicer, so i was thinking of passing the corresponding constant to the DATESYTD, but with no luck.

    Is there any way to pass the values dynamically, i have heard about dynamic constant but have no idea about it. Any examples would be great.

    Thanks in advance.

    Saturday, June 07, 2014 6:23 AM

Answers

All replies