WITH
MEMBER [Measures].[FirstDay] as
(
EXISTING [Date].[Date - Calendar Month].[Calendar Day].Members
).ITEM( 0 ).member_value
MEMBER [Measures].[LastDay] as
TAIL (
EXISTING [Date].[Date - Calendar Month].[Calendar Day].Members
, 1
).ITEM( 0 ).member_value
SELECT
{
[Measures].[FirstDay],
[Measures].[LastDay]
} ON COLUMNS
FROM [OurCube]
WHERE
({[Date].[Date - Calendar Month].[Calendar Year].&[2012],
[Date].[Date - Calendar Month].[Calendar Year].&[2013]})
should deliver that. I simplified the first calculation a bit: as ITEM(0)
already takes the first tuple, there is no need to use HEAD(..., 1)
.
See http://sqlblog.com/blogs/mosha/archive/2007/01/13/multiselect-friendly-mdx-for-calculations-looking-at-current-coordinate.aspx and the predecessor article referenced in the first sentence for some suggestions for "multiselect friendly MDX" from one of the developers of SSAS.