Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

Percentage Calculation

$
0
0

Hi All,

I am using the following MDX to get the Pecentage Sales, which works for all the dimensions. But if I use this measure for two dimensions at the same time, it doesn't work. For example, if I use this calculated measure with Customer Attribute from Customer dimension, it wokrs fine but if I drag another attribute called Product form Product dimension, the percentage shows wierd numbers. Please advise.

CASE WHEN IsEmpty([Measures].[Sales]) THEN 0 ELSE IIF(IsEmpty(Axis(1).Item(0).Item(0).Dimension.CurrentMember.Parent),1,                          [Measures].[Sales]/(Axis(1).Item(0).Item(0).Dimension.CurrentMember.Parent,Measures.Sales)) 
End


Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>