I have a dataset with 1 dimension and 3 measures. I would like to create a stacked bar chart using two of the measures, with another bar chart side by side with the last measure. But somehow, I always end up with 3 separate bar graphs, or all 3 measures stacked together.

1.2K    Asked by KeikoKanda in Tableau , Asked on Dec 10, 2019
Answered by Asutosh Jha

Directly it won’t be done as you will end up creating side by side chart. Let’s consider the sample superstore dataset. Also, consider the dimension as Category and measures as Quantity, Sales, and Profit.

To achieve this, we need to go to the data pane where we need to create a union to duplicate the data.


Now create 3 calculated fields with the names sales-2, quantity-2, and profit-2 with the following details-




Once done, use the category and table name (will come from the union) in column shelf and all measures used in row shelf. Also, make the dual-axis as required.





Your Answer

Interviews

Parent Categories