this example shows how to use YTD:
SELECT
{} ON COLUMNS,
YTD([Date].[Calendar].[Month].[July 2003]) ON ROWS
FROM
[Adventure Works]
the only thing missing is what to do with the set that returns from the query.
this exaple show how to use YTD and Sum:
WITH
MEMBER [Measures].[YTDSum] AS
SUM(YTD([Date].[Calendar].[Month].[July 2003])
, [Measures].[Customer Count])
SELECT
{[Measures].[YTDSum]} ON ROWS
FROM
[Adventure Works]