Hi Greg --
I don't think there are many people here expert enough with MDX to help you with the "how do I write an MDX statement to do this" part of your question. I'd suggest you try Microsoft's Analysis Services forums to address that part of your problem.
After you have an MDX statement that is working, you can fire it from Tableau using a Calculated Member. Here's how you open the dialog into which you'll paste your MDX:
Hope this helps, at least a little!
I was thinking where to put [Measures].[Amount] in the formula. But it turns out in Tableu I do not need the [Measures].[Amount] part. I only need to enter [KPI].[Sales] / [KPI].[Quantity] - first time I tried this it did not work because I made a mistake in formula. In the example I gave a short version, but in fact full formula looks like this:
([Account].[Account BPM KPI].[Sales]) / ([Account].[Account BPM KPI].[Quantity])
But even better version is with IIF (that will handle div.by 0 error):
IIF([Account].[Account BPM KPI].[Sales]=0, NULL , ([Account].[Account BPM KPI].[Sales]) / ([Account].[Account BPM KPI].[Quantity]))
Works pretty well - so if anyone needs this for Tableu this is the way to go.
Thanks for the hint.