I'm trying to turn a cross table that looks like this
into a table which shows the subtotals and percentage over each Group like the example below
Where the percentage is the sales of each product divided by the total sales in each group, so for Product A = 20 / (20+40+30) = 22%
So far, I've managed to use Spotfire built-in subtotal function and the following expression to almost achieved the table I want
Sum([Sales) / Sum([Sales]) OVER (Intersect(Parent([Axis.Rows]),All([Axis.Rows])))
but the only problem is that the percentage for my subtotal row doesn't seems to equal to 100%, instead it is taking the subtotal sales divided by the grand total for all groups, meaning 90 / (90+140) = 39%
Can anyone advise me where did I go wrong and how do I resolve this? Thanks