### 按日期

``````SELECT { [Measures].[Net sales] } ON COLUMNS
FROM [Sales]
WHERE ( { [Department].[Department name].&[WRO], [Department].[Department name].&[KAT]},
{( FILTER([Time].[Date], [Date].CURRENTMEMBER.MEMBER_KEY >= '2015-10-10'))} );
``````

#### 2 个答案:

``````WITH
MEMBER [Measures].[Net sales NEW] AS
SUM(
FILTER(
[Time].[Date].[Date].MEMBERS,
[Time].[Date].CURRENTMEMBER.MEMBER_KEY
>= 20151010
)
, [Measures].[Net sales]
)
SELECT
{
[Measures].[Net sales]
,[Measures].[Net sales NEW]
} ON 0
FROM  [Sales]
WHERE {
[Department].[Department name].&[WRO]
, [Department].[Department name].&[KAT]
};
``````

``````WITH
MEMBER [Measures].[Date_key] AS
[Time].[Date].CURRENTMEMBER.MEMBER_KEY
MEMBER [Measures].[Net sales NEW] AS
SUM(
[Time].[Date].[Date].MEMBERS,
IIF(
[Measures].[Date_key] >= 20151010
, [Measures].[Net sales]
, NULL
)
)
SELECT
{
[Measures].[Net sales]
,[Measures].[Net sales NEW]
} ON 0
FROM  [Sales]
WHERE {
[Department].[Department name].&[WRO]
, [Department].[Department name].&[KAT]
};
``````

``````WITH
MEMBER [Measures].[Date_key] AS
[Time].[Date].CURRENTMEMBER.MEMBER_KEY
SELECT
[Measures].[Date_key] ON 0
[Time].[Date].[Date].MEMBERS ON 1
FROM  [Sales]
WHERE {
[Department].[Department name].&[WRO]
, [Department].[Department name].&[KAT]
};
``````

``````SELECT
[Measures].[Net sales] } ON 0
FROM  [Sales]
WHERE (
{ [Department].[Department name].&[WRO]
, [Department].[Department name].&[KAT] }
, {[Time].[Date].[Date].&[10 Oct 2015]:null}
);
``````

``````SELECT { [Measures].[Net sales] } ON COLUMNS
FROM [Sales]
WHERE ( { [Department].[Department name].&[WRO], [Department].[Department name].&[KAT]},
{( FILTER([Time].[Date], [Date].CURRENTMEMBER.MEMBER_KEY > '2015-10-10'))} );
``````