KNOWLEDGE BASE

How To Label Stacked Bar of 2 Measures By Percent Of Total Separately


Published: 25 Jan 2021
Last Modified Date: 28 Jan 2021

Question

When using measure names / measure values to create stacked bar graph and drag fields (ex: percent of total) to labels,
each mark will show labels of all the fields

User-added image

How to show percent of total separately for each measure?

User-added image

 

Environment

  • Tableau Desktop 

Answer

1. Drag [Category] to [Columns] and [Sales] to [Rows]
2. Drag [Sales] to [Rows] again
3. Right click on the second [Sales] in [Rows] and click [Dual Axis]
4. Right click on the axis and click [Synchronize Axis]
5. Right click on the second axis and click [Show Header] to hide header
6. Right click on the first axis and click [Edit Axis] to change [Axis Title] to Value
7. Change the first Mark Card Type to [Bar] 
8. Change the second Mark Card Type to [Gantt]
9. Drag [Profit] to [Size] of the Gantt Mark Card
10. Change [Color] of the Gantt Mark Card to orange
11. Drag [Sales percentage] to [Label] of the Bar Mark Card
12. Drag [Profit percentage] to [Label] of the Gantt Mark Card
13. Click on [Label] of the Bar Mark Card and change [Alignment] (Vertical) to Center
14. Click on [Label] of the Gantt Mark Card and change [Alignment] (Vertical) to Center

 
Did this article resolve the issue?