1 of 1 people found this helpful
Hi Roy, this is a fundamental problem of this kind of area chart--it can't display negatives. Here are a couple options that come to mind of how you can get around this:
- Use another chart type. Bars, perhaps?
- Create a calculation that takes the absolute value of your measure, use that for the Size mark, and then create a calculation that indicates whether the measure is negative or positive. Then, you can either color the different signs different colors or, better yet, put the positive/negative calculation on rows and separate them into two separate tree charts.
As to your first suggestion: my bosses are quite keen on the treemap for this particular set of data, so changing the graph type would not really be an option.
As for your second suggestion: I will give this a try and see how it looks. Would the placement of the treemap tiles still be correct? Currently the most positive delta goes in the top left. I wouldn't want for example, a value of 4000 and abs(-3950) to be adjacent albeit with different colors. Two separate charts is an interesting idea - I will give this a try as well. I misspoke in my post - it's the result of the calculation that has the negative to positive range, not the original data set, but that's irrelevant here I think.
Thank you for the suggestions!
Happy to help! If you were to just color the tiles based on the sign without doing anything else, then the placement would not be correct.
Two Calculated Fields and one setting in Edit Color enables the use of diverging colors and negative values in Treemaps. Workbook is available on Tableau Public, hover over marks to see positive and negative values.
The strategy: Find the minimum of the Measure and use its absolute value as an offset. Create a Calculated Field that shifts all values by adding the offset, place it on Color. Create another field which is the absolute value of the original, place it on Size. Set Color:Center to the offset. Show the original (unaltered) Measure in Tooltip.
Using Sample Superstore.xlsx:
1. Find Min(Profit)
2. Create 2 calculated fields:
3. Place Pills on Marks card as shown below.
4. Edit Colors set Center to the offset (6,600).
5. Set Tooltip to show original values.
6. You get this.