Assuming the memory problems that you have appear on the Reporting Services server, not the Analysis Services server, you can use the HAVING
clause at the end of the ROWS
select part instead of NON EMPTY
at the start of it to restrict the rows:
SELECT
NON EMPTY { (
[Measures].[SOME MEASURE]
)} ON COLUMNS,
[Organization Structure].[Description].[Description].Allmembers
* [Organization Structure].[ID].[ID]
* [Organization Structure].[ParentID].[ParentID]
*[Products].[Name].[Name]
*[Time].[Hierarchy].[MothsAndDays]
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME, PARENT_UNIQUE_NAME, LEVEL_NUMBER
HAVING <whatever the condition is to display a row>
ON ROWS
FROM [MyCube]
As you did not state exactly how you want to determine the rows that you want to display, I left that as <whatever the condition is to display a row>
above. The way this works is that Analysis Services first builds up the result set for the complete cross product of all row hierarchies, and then evaluates the condition to remove rows from this.