2 Replies Latest reply on Oct 1, 2018 6:03 PM by Esther An

calculate percentage of a stacked bar chart and include it in the tooltip

Hi everyone,

I got a dataset with 2 categories A & B, and I have created a stacked bar chart (please see attached workbook). I have included the number of A/B and Total Orders in the tooltip, and my requirement is to calculate the percentage of A/Total Orders, and the percentage of B/Total Orders.

Then I would like to include the percentages in the tooltip so if we hover over A we will see: Number of A, Number of Total Orders and Percentage of A/Total Orders; and the same for B.

Any suggestions would be highly appreciated! Thanks in advance.

Thanks,

Esther

• 1. Re: calculate percentage of a stacked bar chart and include it in the tooltip

Create 2 calculated fields as follows:

A %

SUM([A])/SUM([Total Orders])

B %

SUM([A])/SUM([Total Orders])

Then drag these to the tooltip card.

See attached.

• 2. Re: calculate percentage of a stacked bar chart and include it in the tooltip

Hi Ken,

Thanks for the solution! I have noticed that hovering over A or B will both display A% and B%. Is it possible to display A% only when hovering over A, and B% only when hovering over B?

Thanks,

Esther