KNOWLEDGE BASE

How to display two bar graphs and two line graphs in one view using reference line


Published: 20 Oct 2022
Last Modified Date: 21 Oct 2022

Question

How to display two bar graphs and two line graphs in one view using reference lines
User-added image

Environment

  • Tableau Desktop

Answer

<STEP 1>
1. Connect to Sample Superstore.
2. Drag [Sales] to Rows.
3. Drag [Sales] to Rows again.
4. Right click on 2nd [SUM(Sales)] on Rows -> Quick Table Calculation -> Running Total.
5. Drag [Profit] to the view as following.
User-added image
6. Right click on [SUM(Profit)] on Measure Values -> Quick Table Calculation -> Running Total.
7. Right click on [Measure Values] on Rows -> Dual Axis.
8. Open Marks of [SUM(Sales)] -> Change the graph type to "Bar".
User-added image

<STEP 2 -Adding a reference line- ->
9. Drag [Profit] to Detail.
User-added image
10. Right click on the Axis of Sales -> Add Reference Line
User-added image
11. Set as following.
User-added image
12. Toolbar -> Format -> Lines -> Change Grid Lines as following.
User-added image

 
Did this article resolve the issue?