CallumVass
CallumVass

Reputation: 11448

SSAS / MDX Query - Show data between 2 dates

I have a query:

select non empty
order ([Item].Children
,([Measures].[Total Line Value]
,[January 2010])
,DESC)
on Columns,
non empty
[January 2010]
on Rows
from [Sales Analysis]
where [Measures].[Total Line Value]

This query shows, in order from highest to lowest, the total sales a particular item has made for the month January 2010. What I would like to do is show the total sales an item has made between 2 specified dates, say January 2010 - March 2011. It just has to be the total value and not the value for each month. Any help would be appreciated, thanks.

Upvotes: 0

Views: 2282

Answers (1)

Max
Max

Reputation: 804

Use "WITH" statement to declare new measure

Sum({[Your dim-n].[January 2010]:[Your dim-n].[March 2011]}, [Measures].[Total Line Value])

Use this new measure on the axis Rows and remove WHERE clause.

p.s. I can't test it now, so I can make a mistake :).

Upvotes: 2

Related Questions