Creating a stacked bar chart with two measures in Tableau is a powerful way to compare and contrast data. This visualization allows you to see the composition of your data and how different measures contribute to the whole. Here's a step-by-step guide to help you create this chart.

Before we dive in, ensure you have your data source connected to Tableau and that you're familiar with the basics of the software. Let's get started!

Preparing Your Data
To create a stacked bar chart with two measures, you'll need to have your data structured in a specific way. You should have one dimension (e.g., category, time, geography) and two measures (e.g., sales, profit, quantity).

For example, your data might look like this:
| Category | Sales | Profit |
|---|---|---|
| Electronics | 5000 | 1000 |
| Clothing | 3000 | 500 |
| Books | 2000 | 300 |

Creating the Data Source
In Tableau, drag and drop your data source onto the canvas. Ensure that your dimension and measures are correctly identified. If not, right-click on the field and select 'Convert to Dimension' or 'Convert to Measure' as needed.
For our example, 'Category' should be a dimension, and 'Sales' and 'Profit' should be measures.

Creating the Stacked Bar Chart
Now that your data is ready, let's create the stacked bar chart.
1. Drag your dimension (e.g., 'Category') to the Columns shelf. This will create bars for each category.

2. Drag your first measure (e.g., 'Sales') to the Rows shelf. This will create a bar for each category, with the length representing the sales value.
3. To create the stack, drag your second measure (e.g., 'Profit') to the Color shelf. This will create a second bar within each category bar, representing the profit value.




















Customizing Your Chart
Your basic stacked bar chart is now created. However, Tableau offers many customization options to make your chart more informative and visually appealing.
Here are some customization ideas:
Sorting and Filtering
You can sort your bars by size by right-clicking on the dimension on the Columns shelf and selecting 'Sort'. You can also add filters to limit the data shown in your chart.
For example, you might want to sort your categories by sales in descending order and filter out categories with low sales.
Adding Labels
To add labels to your bars, right-click on the measure on the Rows shelf and select 'Label'. You can choose to show the value, percentage, or both. You can also adjust the label font, size, and color.
For a cleaner look, you might want to show only the percentage labels and hide the value labels.
Changing the Color Scheme
To change the color scheme of your stacked bars, right-click on the measure on the Color shelf and select 'Edit Colors'. Here, you can choose from various color palettes or create your own.
You can also adjust the opacity of your colors to create a semi-transparent effect, making it easier to see the composition of your bars.
There you have it! You've created a stacked bar chart with two measures in Tableau. Now you can explore your data, create insightful visualizations, and make data-driven decisions. Happy data visualizing!