Creating a horizontal stacked bar chart in Tableau can be a powerful way to compare and contrast data across different categories. This visualization allows you to see the composition of each category and how they stack up against each other. Here's a step-by-step guide to help you create this chart.

Before we dive into the process, ensure you have your data prepared in Tableau. For a horizontal stacked bar chart, you'll need at least two dimensions (categories) and one measure (the values you want to compare).

Preparing Your Data
Start by connecting your data source in Tableau. For this example, let's assume you're using a simple dataset with 'Category', 'Sub-Category', and 'Sales' columns.

Your data should be structured like this:
| Category | Sub-Category | Sales |
|---|---|---|
| Furniture | Chairs | 5000 |
| Furniture | Tables | 3500 |
| Office Supplies | Paper | 2000 |
| Office Supplies | Pens | 1500 |

Creating the Chart
Once your data is connected, follow these steps to create your horizontal stacked bar chart:
1. **Drag and Drop**: Drag the 'Category' dimension to the Columns shelf, and the 'Sub-Category' dimension to the Rows shelf. Drag the 'Sales' measure to the Color Marks card.

2. **Switch to Bar Chart**: By default, Tableau creates a scatter plot. Right-click on the plot and select 'Change Mark Type' > 'Bar'.
3. **Stack the Bars**: Right-click on the 'Sub-Category' dimension in the Rows shelf and select 'Stack Mark'. This will stack the bars horizontally, allowing you to compare the 'Sales' within each 'Category'.
Customizing Your Chart

Now that you have your basic chart, you can customize it to fit your needs:
1. **Sorting**: Right-click on the 'Category' or 'Sub-Category' dimension in the relevant shelf and select 'Sort'. You can sort by data values, alphabetically, or manually.



















2. **Formatting**: Click on the 'Format' tab in the top menu. Here, you can change the color palette, add borders, adjust labels, and more.
3. **Adding Titles**: Drag the 'Category' dimension from the Columns shelf to the 'Columns' shelf on the left. This will create a title for your x-axis. Do the same for the 'Sub-Category' dimension to create a title for your y-axis.
Creating a horizontal stacked bar chart in Tableau can help you gain valuable insights from your data. With a bit of customization, you can create a compelling and informative visualization that tells a story. Happy data exploring!