Show Stacked Bar and Standard Bar Chart side by side
Today's Topic is showing differnt type of Bar chart side by side.
Actullay it's easy enough, but I got some questions from my collegues.
I used Tableau's sample data from the site.
Sample - Superstore Sales (Excel).xls |Tableau Support Community
Let's start from this type of view.
What we need to do are
- Group Low height items
- Show Stackd Bar cahrt only for Grouped Items.
Starting from sort by decending order.
We got below VIZ.
Group the items whose sales are below $500K.
There are multiple methods to do this, but I use LOD formula in this case.
[Province 2]
if {fixed [Province]:sum([Sales])} > 500000 then [Province] else "Small Sales" END
The function of "Fixed + Sum" is similar to EXCEL's "SUMIF" or "SUMIFS"
{fixed [Province]:sum([Sales])} means that nevertheless of other fields value, sum up with field of "Province".
Let's put [Province 2] on Column shelf instead of [Province].
We got below VIZ.
Becasue we chaged dimension, need to re-sort on [Province2]
When we put [Province 2] in color shelf, it looks below VIZ.
In Tableau's settnig, Items in column and Items in Label or Color etc are not neccessarily matched easy other.
So, we put [Province] instead of [Province 2] in color shelf.
Now we can see only [Small Sales] has Stacked Bar with different color.
Actually, the chart type stays same as "Standard Bar Chart", but with using different dimension as Color, you can show the standard bar chart like stacked.
Rest of small things.
Let's sort color legnend's order.
And this is completed VIZ.
OK, let's Play around and Enjoy!