How to Remove minus Values from the Sum of the Reference Line While Keep Showing minus Values on the Graph

Published: 29 Nov 2023
Last Modified Date: 30 Nov 2023


Assuming that a stacked bar chart like [Original sheet] worksheet in the Sample.twbx is created.
How to remove minus values from the sum values of the reference line while keep displaying the minus values on the graph.
User-added image


  • Tableau Desktop.


1. Create a calculated field [Profit(exclude minus value)].
IF SUM([Profit])<0 THEN NULL
ELSE SUM([Profit])

2. Add the calculated field "Profit (exclude negative values)" to the "Details" card of the mark card.
User-added image

3. Right-click the y-axis (profit axis) and click "Add Reference Line"
User-added image

4. Select "Profit (excluding negative values)" from the Line > Value menu and configure the settings.
User-added image

Please check the [Example] worksheet in Sample.twbx for more details.
Did this article resolve the issue?