The way you wrote your query, the weeks on the row are irrelevant to the result, as your Filter
statement overwrites the context of the Week calendar
hierarchy. You should write your query as
WITH
MEMBER [Measures].[Shop WBC]
AS SUM
([Shop].[Shop ID].[Shop ID].Members,
IIF((Filter(EXISTING [Time].[Week calendar].Members, [Measures].[Sales] IS NULL).Count > 0, NULL, 1)
)
SELECT
([Time].[Week calendar].[Week]) ON ROWS,
([Shop].[Geo].[Region].Members, [Measures].[Shop WBC]) ON COLUMNS
FROM [Testable]
WHERE [Time].[Week].&[201301]:[Time].[Week].&[201319]
Furthermore, in MDX, the WHERE
clause is used much less frequently than in SQL. And, formally, it is illegal MDX to state the rows first. Proper MDX states the columns first and then the rows. However, Analysis Services is tolerant here. I would re-write the above query as
WITH
MEMBER [Measures].[Shop WBC]
AS SUM(
[Shop].[Shop ID].[Shop ID].Members,
IIF((Filter(EXISTING [Time].[Week calendar].Members, [Measures].[Sales] IS NULL).Count > 0, NULL, 1)
)
SELECT
[Shop].[Geo].[Region].Members
* { [Measures].[Shop WBC] }
ON COLUMNS,
[Time].[Week calendar].&[201301] : [Time].[Week calendar].&[201319]
ON ROWS
FROM [Testable]