If you are using a stacked bar chart on your dashboard and your stakeholders are looking to compare a few variables over time, as a minimum requirement you must have dynamic sort built into the visual. What I am going to show you today is the next level of interaction that will make your stacked bar chart stand out. Let’s get straight to it.

Step 1:

The first step is to create a bar chart with dynamic sort, let’s talk about why we use Dynamic sort. When comparing a variable over time, it’s easier for people to analyse trends when all the bars of the variable being compared start at zero. If you are unfamiliar with how to create it, here is a summary of the steps. 

  • Using the Sample Store dataset, create a simple stacked Bar Chart, and let’s say you drag Sub-Category to colour.
  • Create a Parameter using Sub-Category
  • Create a Calculated field with this formula, let’s call is SortSub-Category 
    • IF [Sub-Category] =  [Sub-Category Parameter] THEN 1 ELSE 0 END
  • You have to configure the dynamic sort in two areas, 
    • On the Sub-Category pill that you placed on Colour Right 
    • Once you place the visual on your dashboard, create a dashboard action for it. 

You can download a copy of the workbook here to view the detailed configuration. 

Now that you have a bar chart that Sorts dynamically, you will notice that many variables account for a small percentage of the total, it becomes hard to visually compare variance over time even when you have it at the bottom. In this example below, if you look at Copiers sold, for the months of May and July it’s hard to compare which month had better sales. You can try using the tooltips, but then some marks are so thin, like the Sales for Machines in May.

Note: For the purpose of this demonstration, I’ve filtered the data down to Technology Sales for the year 2021.


It’s often that when you are on placement, you might have upwards of 8-10 variables, so here’s how you can Level up Stacked Bar charts. 

Step 2:

Create a Set – Since we are using Sub-Category in this example, create a Sub-Category Set. Choose ‘Use all’ in the dialogue box and say OK

Step 3:

Create a calculated field and drag the set into it. 


Step 4:

Place the calculated field on to the Filters pane and set it to True.

Step 5:

Once your visual is on the dashboard, go to Dashboard >> Actions >> Change Set values and follow the settings shown below. 

Bonus Tips! Create Highlight actions and Target the Sub-category as well, so when you select a variable it highlights the entire date range, instead of just the mark selected.  And add Labels to show when highlighted. Download workbook for details. 

Now, when you select a variable, the selected variable comes to the forefront, deselect by clicking the bars again or anywhere within the chart area, this would then show all the variables and place the one you previously selected at the bottom. With this technique you can clearly see that Copier sales in July were approximately $100 more compared to May and even the thinnest mark, like Machine sales in Feb can be easily compared over time. 


I hope you liked this, Enjoy!


Jude Shu
Author: Jude Shu