4 Replies Latest reply: Jul 16, 2018 10:10 AM by Sunny Talwar

# Percentage calculation

Hi Experts,

I have a  pivot table like below from Measure please help me to calculate the Percentage column

Dimension            Measure(Count(ID))                  Percentage

Sales

Product 1               43                                              -

Product 2               21                                             21/43 = 48.84%

Product 3               22                                             22/43=51.16%

Division

Product 1               4                                              -

Product 2               1                                            1/4 = 25.00%

Product 3               3                                             3/4=75.00%

• ###### Re: Percentage calculation

May be this

Count(ID)/Count(TOTAL {<Division = {'Product 1'}>} ID)

or

Count({<Division -= {'Product 1'}>} ID)/Count(TOTAL {<Division = {'Product 1'}>} ID)

• ###### Re: Percentage calculation

Hi Sunny,

Thanks for your reply. I have tried both expression which you have mentioned. But those are not working. Please find the below attached sample app with expected output.

Here Dim1 Division Product1 sum need to use for dividing remaining two products same like Dim1 Sales Product1 sum need to use for dividing remaining two products.

• ###### Re: Percentage calculation

Try this

Sum({<Dim2 -= {'Product1'}>} Ids)/Sum(TOTAL <Dim1> {<Dim2 = {'Product1'}>} Ids)

• ###### Re: Percentage calculation

Try,

Count(ID)/max(Total Count(ID))