RichardRayJH
New Member
- Joined
- Jan 18, 2013
- Messages
- 24
I work at a ski resort. Our primary operating season is from late November through April, with another operating season in the summer (Memorial Day through second week in October) and two non-operating 'shoulder seasons'. Everything I do is bounded by those dates: not quarters, not a fiscal year, not months, but by those 'seasons'. Sometimes weeks in the season are of interest (Winter 2012-2013 Week 8, etc.) or even a day over day comparison (Winter 2012-2013 Presidents Day vs. Winter 2011-2012 Presidents Day). I've figured out roll-my-own analogs for lots of the time intelligence functions, but before I wander off into the underbrush I thought I'd ask about this one....
Our Opening Day is always the Saturday after Thanksgiving, whatever date that may be. Our closing day is always the first Sunday in April, whatever date that might be. I've got a table with those dates (as well as dates for other 'moveable feasts' throughout the year), so calculating the dates isn't part of the challenge. What I want here is a 'SeasonToDate' function.
i.e. - Given that this year we opened on 2012-11-24 and will close on 2013-4-7, how do I do a generic function similar to the native DAX TotalYTD function? The built in version lets me stipulate the End of Year date, but not the start of year.
I've considered layering calls to the existing TotalYTD functions to do something like this (using the current season as an example):
SeasonToDate := (TotalYTD(for the year 2012 ending 12/31/2012)-TotalYTD(for the year 2012 ending 11/23/2012))+TotalYTD(for the year 2013 ending 2013/4/7)
I think that would work, but am hoping there's something a little less compute intensive. My data sets are in the 10's of millions of of rows and the top level report compares seasonal performance over the last 5 seasons, so I'd like to minimize the number of times I have to sum various parts of the data set....
Our Opening Day is always the Saturday after Thanksgiving, whatever date that may be. Our closing day is always the first Sunday in April, whatever date that might be. I've got a table with those dates (as well as dates for other 'moveable feasts' throughout the year), so calculating the dates isn't part of the challenge. What I want here is a 'SeasonToDate' function.
i.e. - Given that this year we opened on 2012-11-24 and will close on 2013-4-7, how do I do a generic function similar to the native DAX TotalYTD function? The built in version lets me stipulate the End of Year date, but not the start of year.
I've considered layering calls to the existing TotalYTD functions to do something like this (using the current season as an example):
SeasonToDate := (TotalYTD(for the year 2012 ending 12/31/2012)-TotalYTD(for the year 2012 ending 11/23/2012))+TotalYTD(for the year 2013 ending 2013/4/7)
I think that would work, but am hoping there's something a little less compute intensive. My data sets are in the 10's of millions of of rows and the top level report compares seasonal performance over the last 5 seasons, so I'd like to minimize the number of times I have to sum various parts of the data set....