KNOWLEDGE BASE

How to Display the Sales Target Value on Stacked Bar Chart with Reference Line


Published: 16 Nov 2022
Last Modified Date: 17 Nov 2022

Question

How to display the sales target value on stacked bar chart with reference line.

Environment

  • Tableau Desktop

Answer

When adding the average of target sales as a reference line to a stacked bar chart, it needs to be calculated as a weighted average, not as simple average.

Below is an example using Sample - Superstore data.

1. Create a stacked bar chart.
2. Create a calculated field and enter sales target value. 
User-added image
3. Drop Monthly Sales Target field to Detail.
4. Open Analytics pane and drag and drop Reference Line to the view.
5. Set Reference Line as follows.
User-added image
Did this article resolve the issue?