You can do this by using a calculated field for labels instead of the standard field.
Something like this:
IF SUM([MyVal]) > 0 THEN SUM([MyVal]) END
Hope this helps!
That doesn't seem to solve my problem when dealing with a stacked bar chart. See attached.
Why does Tableau label the negative values with the total sum amount?
See Payer = D.
Total = 125
Why is there a data label on the Maint amount?
Thanks for your time,
Tableau_HELP.twbx 13.3 KB
Ah... I see the issue. Measure names/values limits your access to this, since it is technically 3 different fields.
You could do it; but you'd have to show all three fields and make 2 more calculations. It would definitely clutter up the viz quite a bit.
An alternative would be to hide the labels manually... but that will not work well going forward with future data refreshes.
What appears to be happening is that you are actually labeling all values with the maximum value of the three measures, but the option to not allow labels to overlap other marks is hiding the labels that would appear on top of a bar. When there are negative values the label for the most negative no longer overlaps a bar so it appears. Here is something to try which might work, provided I'm understanding what you are wanting to do.
Place the Measure Values pill on the labels. Then click on labels to setup the labels to display only the maximum value in the cell like this:
Hope this helps