I have a cube that consists of several dimensions and metrics. I have a metric 'cost' and i would like to get a percentage cost for the record over the total cost based on the segments that the user selects. For example:
If the user selects dimension: 'Campaign', 'Adgroup' and 'Keyword', the result set should calculate the '%cost' as below. All '%cost' should add up to 1.
If the user selects dimension: 'Campaign', the result set should calculate the '%cost' as below. All '%cost' should add up to 1.
How am i able to write a formula in SSAS cube calculation to enable me to dynamically calculate the %cost based on the segment a users selects?
I have the current formula as ([Keyword].[Keyword].CurrentMember, [Measures].[Cost])/
(sum(Axis(1),[Measures].[Cost]))
. It works but takes long time to calculate. I am wondering if there is a better way to do this.
Thanks in advance.