Have you tried the BIDS to build such mDX query, it is achievable using that tool with a AS project.

Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderatorhttp://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. The greatest discovery of my generation is that a human being can alter his life by altering his attitudes of mind.