Stack bars - how to calculate percentage of group within each bar?

When trying to find percentage of a group, for example as within a stacked bar chart, one way is to use use Analytic Functions.

Here we see a stacked bar chart showing quantity by province broken out by priority. What we want is each stack bar to show a percentage of our 100% for each province

We can apply “Analytic Function” -> Percentage of Group

Choose the correct dimension to group by (which in our case is province - that’s what appears in the x-axis)

image

image

We can apply display format as well to make sure it appears as percentage.