How to show percentage in all blocks of bar chart, where sum of each column should be 100%?
I have a stacked bar chart, with years as dimensions and the expression sum(Amount) / sum( Number) and want to express this as a %. I enabled 'Plot Values inside Segments' on the Presentation Tab and set it to show relative. The problem here is it shows the value of each block as a % of all the blocks, whereas I need it to show as a % of the respective column. I think a solution in the script cannot be used as it has to be dynamic to selections (which are many).
Ex: In the image, the value for 2018 shows 16.51%, whereas i want it to show 100%. For 2019, it shows 18.4% and 16.6%, which sums to 35.1%, but I want it to sum to 100%.
Hi @travi , here an example , please check if it works for you :
Test script :
LOAD * INLINE [ Amount, Number, Year, Dim2 23, 2, 2018, a 34, 3, 2018, a 45, 4, 2018, b 56, 5, 2018, b 67, 6, 2019, a 78, 7, 2019, b 534, 8, 2019, c 87, 7, 2020, a 654, 6, 2020, b 443, 5, 2020, c 43, 4, 2020, d ];