KNOWLEDGE BASE

How to add a certain label in the middle of a bar graph


Published: 03 Mar 2023
Last Modified Date: 03 Mar 2023

Question

How to add a certain label in the middle of a bar graph?
e.g.
User-added image

Environment

  • Tableau Desktop

Answer

1. Create a calculation field like below.
Label
if  floor(min({fixed:countd([Order Date])})/2) = index()
then [Sales_total]
END

Dual Axis
if  floor(min({fixed:countd([Order Date])})/2) = index()
then 0.9 //you can change the position of the label by changing this number and also the range of Dual Axis
END

2. Add Dual Axis to Rows, right click it and select Dual Axis.
3. Change the Mark type of Dual Axis to Text.
4. Add Label to the Label of Dual Axis.
5. Edit the format of the Label.
6. Right click the right axis, uncheck Show Header.
Did this article resolve the issue?