--Internet sales Amount Year & Monthwise (avoid All Member [All] and use dimension members from hierarchy )
select [Measures].[Internet Sales Amount] on columns,
{[Date].[Calendar Year].children*[Date].[Month of Year].children } on rows
from [Adventure Works];

--Year 2007 and sales amount>4000, we can use hirarchy year on axis
select [Measures].[Internet Sales Amount] on columns,
filter({[Date].[Calendar Year].children*[Date].[Month of Year].children*[Customer].[Customer].[Customer].members },([Measures].[Internet Sales Amount]>4000)) on rows
from
(select [Date].[Calendar Year].[CY 2007] on columns from [Adventure Works]);

-- Remove empty cells from measures or remove all those month which does not have any sales
select [Measures].[Internet Sales Amount] on columns,
nonempty ([Date].[Calendar].children*{[Date].[Month of Year].[March],[Date].[Month of Year].[April] } )on rows
from [Adventure Works];

-- Calculate Profit margin (InternetSalesAmount-InternetTotalProductCost) using member
with member Profitmargin as
([Measures].[Internet Sales Amount]-[Measures].[Internet Total Product Cost])
select Profitmargin on columns,
[Date].[Calendar].[Date].ALLMEMBERS on rows
from [Adventure Works];

with member samanth as ([Measures].[Internet Sales Amount]-[Measures].[Internet Tax Amount])
select samanth on columns,
nonempty([Date].[Date].allmembers) on rows
from [Adventure Works];

WITH MEMBER [MEASURES].[T2] AS
[Customer].[State-Province].CURRENTMEMBER.UNIQUE_NAME
MEMBER [MEASURES].[T3] AS
[Customer].[State-Province].CURRENTMEMBER.MEMBER_cAPTION
MEMBER [MEASURES].[T4] AS
[Customer].[State-Province].CURRENTMEMBER.UNIQUENAME
select {[MEASURES].[T2] ,[MEASURES].[T3] ,[MEASURES].[T4] }
on 0,
[Customer].[Customer Geography].[State-Province].members DIMENSION PROPERTIES UNIQUE_NAME,MEMBER_KEY on 1
from [Adventure Works];

WITH MEMBER [MEASURES].[T1] AS
[Employee].[Employees].CURRENTMEMBER.UNIQUE_NAME
SELECT [MEASURES].[T1] ON 0
,
[Employee].[Employees].MEMBERS DIMENSION PROPERTIES UNIQUE_NAME,MEMBER_KEY ON 1 FROM [Adventure Works];

--// using periods to date for same purpose for doing some upto specified month or for doing running total as per different combination
with member testmember as
Aggregate
(
PeriodsToDate([Date].[Calendar].[Calendar Year]), [Measures].[Internet Sales Amount]
--PeriodsToDate( [Date].[Calendar].[Calendar Year] ,[Date].[Calendar].[Month].&[2006]&[3] ),[Internet Sales Amount]
)
select {testmember,[Measures].[Internet Sales Amount]} on columns,