WITH
MEMBER [Measures].[BelowZero] AS
case when ([Measures].[MyValue]) < 0
then 1
else 0
end
MEMBER [Measures].[BelowZeroCount] AS
SUM([Accounts].[Number].ALLMEMBERS, [Measures].[BelowZero])
SELECT NON EMPTY
{
[Measures].[BelowZeroCount]
} ON COLUMNS
FROM
(
SELECT (STRTOMEMBER('[Date].[20130801]', CONSTRAINED) : STRTOMEMBER('[Date].[20130831]', CONSTRAINED)) ON COLUMNS
FROM [TEST_DW]
)
or
WITH
MEMBER [Measures].[BelowZeroCount] AS
Filter([Accounts].[Number].ALLMEMBERS, [Measures].[MyValue]) < 0).Count
SELECT NON EMPTY
{
[Measures].[BelowZeroCount]
} ON COLUMNS
FROM
(
SELECT (STRTOMEMBER('[Date].[20130801]', CONSTRAINED) : STRTOMEMBER('[Date].[20130831]', CONSTRAINED)) ON COLUMNS
FROM [TEST_DW]
)