I have a calculated member that shows total of a selected date range that I use as a denominator for an average calc. However, excel seems to not recognize the "existing" function. Does anyone have a work around?
Here is my current script which returns the following result in SSMS:
with
set [dates] as
{existing([Dim Date Time].[Calendar Date].[Calendar Date])}
member [total] as
sum([dates]
,[Measures].[Test Volume])
select {[Test Volume],[total]} on 0,
[Dim Date Time].[Calendar Date].[Calendar Date]
on 1
from [Test_DW]
where
{filter([Dim Date Time].[Year-Month-Day].members,
cstr([Dim Date Time].[Year-Month-Day].member_caption) = "2010-10-01 00:00:00").item(0)
:filter([Dim Date Time].[Year-Month-Day].members,
cstr([Dim Date Time].[Year-Month-Day].member_caption) = "2010-10-09 00:00:00").item(0)
}
Test Volume total
2010-10-01 00:00:00 9161 69482
2010-10-02 00:00:00 6259 69482
2010-10-03 00:00:00 4225 69482
2010-10-04 00:00:00 10321 69482
2010-10-05 00:00:00 8817 69482
2010-10-06 00:00:00 9010 69482
2010-10-07 00:00:00 9082 69482
2010-10-08 00:00:00 7670 69482
2010-10-09 00:00:00 4937 69482
In excel the total column is pulling the total of all dates regardless of the filter selection by the user.
Any ideas would be most appreciated.