There are a number of ways to do this given the simple layout of your time dim, if it were me, I would just set a member range since you know the starting and ending members of the range.
Datepart is not going to work because you do not have dates, you have strings that just happen to look like dates.
To answer your specific question you would use the following
CASE
WHEN SUBSTRING([Date].CurrentMember.MEMBER_NAME, 1,4) = ("2011") THEN 1
WHEN SUBSTRING([Date].CurrentMember.MEMBER_NAME, 1,4) = ("2012") THEN 1
ELSE 0 END'
Note that CurrentMember returns a member, the substring function is expecting a string, so you need to add the property MEMBER_NAME to get the member as a string.
To use a member range you could do something like
CASE
WHEN Contains([Date].CurrentMember,
MemberRange([Date].[2012-12-31], [Date].[2012-12-31].FirstSibling))
THEN 1
ELSE 0 END
You could then set the [2012-12-31] as a subvar on the server and update it when the year changes without having to touch the outline.
Couple of other ways to do this but either of these should be sufficient.
Good luck
Scoring disabled. You must be logged in to score posts.