Comparing fields using different sheets or charts can be difficult for a user having a limited sort of time. Suppose the user wants to see and compare more than one value at a time but the values represented are somewhere on a different sheet when here the problem arises. keeping the comparing sheets next to each other can sort of give a short-term solution to it. But here we will talk about how a dual-axis can help in comparing different values. More specifically, Dual-axis charts are useful for demonstrating the relationship between two or more measures with different amplitudes and scales.
Let’s understand more about dual-axis charts with an example,
For example: Using the sample superstore dataset, create a visualization where we can compare the per cent of sales & profit of different subcategories. Compare the sales and profit using a dual-axis.
Here are some of the major steps that can be used and kept in mind while creating a dual-axis with different measures.
- Here, we will start by dragging Sales and profit from the data plane to the rows shelf and subcategories to the columns shelf. Use aggregation as SUM() for both the measures. We can use any mark type for the chart but here we will set the chart type to the bar.
- Here we have SUM(Profit) and SUM(Sales) in the tables, but here we can see some categories are showing negative values in SUM(Profit), so we can just filter them out to have a clear visualization between all the positive values.
- To filter out the subcategories that give negative profit can be excluded by dragging the sub-category to the filter shelf and choosing which subcategories we want to exclude.
- After excluding the sub-categories, if we look at the example we want a per cent of sales and profit. The “percentage of” is a Table calculation. To add a quick table calculation to the measure, Go to the Analysis option in the pane, choose ‘Percentage of’ and select Table because we want the table calculation on all measures available in the sheet.
- After excluding the sub-categories, if we look at the example we want a per cent of sales and profit. The “percentage of” is a Table calculation. To add a quick table calculation to the measure, Go to the Analysis option in the pane, choose ‘Percentage of’ and select Table because we want the table calculation on all measures available in the sheet.
- Now we have the table calculation on both the measure values, now we will step up to do it dual-axis. For making the chart dual-axis, Proceed by clicking on the small arrow on the SUM(Profit) and select dual-axis.
- Here we have the SUM(Sales) and SUM(Profit) on the same axis but the synchronization of the axis needs to be checked for a proper data comparison.
- For synchronization of the axis, Right-click on any one of the measures on the axis and simply click on the ‘SYNCHRONIZE AXIS’.
- At last, we have the synchronization of both the measures but yet we can not differentiate the bars between Sales & Profit because we have the same sizes of bars for both Sales & Profit. One way is to reduce the size of the Profit measure bar and we can do it by dragging the SUM(Profit) from the data pane to the ‘SIZE’ of the SUM(Profit) mark label.
Yayy!! That’s the dual-axis chart we were looking forward to. Having a dual-axis can add more value to the visualization because we can compare two-measure at once.
Hoping the steps mentioned in the blog helped the viewers in Creating a visualization of the dual-axis and also using Table calculations.
Check out other useful Tableau charts below:
- How to create a rounded bar chart in Tableau
- How to create a donut chart in Tableau
- Edit Table calculation in Tableau
- Switch Between YoY and MoM using Parameter Selection
- Add Map Layers in Tableau
Follow us on Twitter, Facebook, Linkedin, and Tableau Public to stay updated with our latest blog and what’s new in Tableau.