This is not a complete post. I came across a situation that I needed to show [Date] dimension values which is not empty as report parameter.
But I need yeas that only have values in measure. there for I used following MDX to get that.
member yKey as [Date].[Year].currentmember.uniquename
member yValue as [Date].[Year].currentmember.MEMBER_CAPTION
} on 1
this code result in getting