2
votes

Being an SSAS newbie, I was wondering if it's possible to create a calculated member that references an individual row's value as well as the aggregated value in order to create a percentage?

For example, if I have a fact table with ValueA, I'd like to create a calculate member that essentially performed:

[Measures].[ValueA] (for each row I've sliced the data by) / [Measures].[ValueA] (the total)

Also I'd like to keep the total as the sum of whatever's been filtered in the cube browser. I feel certain this must be possible but I'm clearly missing something.

1

1 Answers

2
votes

You can use the Axis function. Her is an example:

WITH MEMBER [Measures].[Percentage] AS
     [Measures].[ValueA] / (Axis(1).CurrenMember.Parent, [Measures].[ValueA])
SELECT {[Measures].[ValueA], [Measures].[Percentage]} ON 0,
'what you want' ON 1
FROM your cube

(You may need to add check in the calculated member expression)