Sorting Stacked Bars Through Parameter Actions

Stacked bar charts are used to show the parts of of a whole. However, comparing stacks of same dimensions become difficult when they are not at the the bottom. In todays blog, I will show how to move a dimension to the bottom of a stacked bar chart using parameter actions.

The example below shows how much sales is made per ship mode in each given year on a quarterly basis.

However the lengths of the stacks cannot be compared perfectly except for the Standard class which falls at the bottom of all the bars. Visually comparing these two bars in Q1 and Q2 of 2022 which fall under second class could lead to faulty conclusions of Q2 being greater than Q1.

But when these stacks are brought to the bottom, a proper comparison can be done without tool tips.

How can we achieve this?

  1. Create a ship mode Parameter after creating the stacked bar chart

2. Create a calculated field to use the parameter

3. Sort your ship mode field on colour by your calculated field ascending and select maximum.

4. Show your parameter and test whether it is functioning per your sort. It should work now but only through the parameter and not by clicking on the stack.

5. We now need to set a parameter action which will permit functioning by clicking. Click on the worksheet tab and choose Action. Click on add action and select change parameter. Give your action a name, select source sheet = your_sheet_name, target parameter = your_parameter and source field = your_dimension_field_on_colour_which_has_been_sorted_by_the calculated_field. Leave the action to run on select and clearing the selection on keep current value. Click OK twice.

Your parameter action should now work by a click on any of the stacks.

The downside of this is that, as soon as this sheet is moved unto a dashboard, the action stops functioning and would have to be reconfigured as a dashboard action before it works.

I cant end this blog without acknowledging Matty Sweet of DS27 for teaching me this technique and my Coach Jenny Martins for reinforcing it.

I hope this tip helped. Thanks for reading.

Author:
Michael Apau
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab