Question: how to get mdx query from excel?
Answer: Open the Power Pivot window.
Click Home > Get External Data > From Database > From Analysis Services or Power Pivot.
In Table Import Wizard, provide the name of an Analysis Services multidimensional server and choose the database. ... 
Paste in the MDX query in the MDX Statement window.
Click Validate.