Tableau: How to create a Side by Side Bar Graph with Overlaying Line Chart
Updated: May 14
Select all of your metrics. Right click one of them. Select Transform > Pivot. This will give you pivot field names and pivot field values.
Create this calculated field for your bar values.
If [Metric] = “Metric1” or [Metric] = “Metric2” then [Value] end
Create this calculated field for your line values.
If [Metric] <> “Metric1” and [Metric] <> “Metric2” then [Value] end
Create a dual axis chart with [Bar values], [Line Values], and [Date].
To separate the stacked bar chart, use this calculation on the columns shelf.
If [Metric] = “Metric2” then month([Date])+.5 else month([Date]) end
Add color and set as dual axis.