Do you want a way to call out the metric a user selects in a dashboard? In my World Happiness Report 2023 Tableau dashboard here; I have two charts a Dot Plot and and a Bar chart at the top of the dashboard. If you select a Region from the left hand navigation pane, it will change the background color for the selected Region in both of these charts.
Demo is in the video clip below!
I got this idea from Lindsay Betzendahl's blog post How to Create Halos Around Bar Charts here.
So how did I do this? I will show you how I completed this with using the Sample-Superstore data set.
First I created a Parameter called IsSelected and added all of the Regions in my data. I automatically imported all the fields by selecting it as shown below;
Then I created a calculated field for this Parameter.
I proceeded to create my Bar chart with placing Region on the Rows shelf and then Sales on the Columns shelf.
I placed Region on the Color marks card. I also added a white border to these bars by selecting it from the Color marks card drop-down;
I then placed Tableau's Measure Values on the Columns shelf before the SUM(Sales). This will automatically add all of the Measures onto a Measure Values card on the worksheet.
I right-clicked on the empty space on this Measure Values marks card to create an inline calculation by selecting New Calculation.
There I typed in Min(0) and clicked enter.
I removed all of the Measure Values except for this calculation and SUM(Sales).
On the Columns shelf, I right-clicked on SUM(Sales) and made it a Dual Axis.
I then synchronized this axis on the worksheet.
On the SUM(Sales) marks card, I changed the Mark Type to a Bar. I also removed the Measure Values from this Marks card. I moved the Size slider down to the notch.
Then on the Measure Values Marks card, I changed the Marks Type to a Line.
I also moved Measure Values to Path. I used the Size slider to make the line as wide as possible.
I moved the IsSelectedRegion calculated field to the Color marks card. This replaced Region on color. This step will place a rounded bar around the bars with central highlighted in Orange.
You can change these colors to be neutral grey and the highlighted one to a darker grey.
I wanted all of these bars to be a uniform highlight. So I created a calculation with the maximum sales value of 800000. I replaced the SUM(Sales) with this calculated field on the Measure Values card. I also changed it to a Maximum aggregation instead of a SUM.
The bar chart appeared as below;
Now when I select a different Region from the IsSelected Parameter, the highlighted bar will change.
I also applied this functionality to a Dot plot in my dashboard. Instead of using Measure Values, I created a Dual axis with an inline calculation of MAX(1). This is because the Dot plot was using values that were under the value of 1. Additionally this Max(1) Marks card is a Bar instead of a Line Marks Type.
On the dashboard I applied a Parameter action based on the IsSelected Parameter, so when users select the Region the highlight changes.
Feel free to download my Tableau Public World Happiness dashboard to see how it is configured.
Comments