A quick tip for you: Ever get some SQL or MDX sent to you in an email, or copied from a website, or pulled from SQL Profiler, that is difficult to understand because it’s not formatted? Well, there are a couple of free tools that will clean up your SQL: SQLinForm and Instant SQL Formatter. Simple copy and paste in the SQL, hit the “Format” button, and wallah, nice clean SQL!
The tools to cleanup MDX are from Nick Medveditskov at this Microsoft site (does DAX too) and from Mosha Pasumansky.