4 Replies Latest reply on Dec 3, 2018 8:08 PM by Coco Lee

# How to create 100% stacked bar chart with calculated measures

I am new to Tableau. I tried to search on forum, but I still haven't found a solution for my problem, could anyone can help please?

How can I turn the below chart into 100% stacked bar chart?

Source data    >> in respondent level, each record contains survey date and servicing score given by customer

Columns         >> Year(Date) Quarter(Date) Month(Date), where "date" is the survey date

Row                >> WINDOW_SUM(COUNT([Score]), -2, 0), where "score" is the value of servicing score.

I want to show the count of servicing score of rolling 3 months. i.e for Feb, it show the count of score from Jan-Feb, for Mar, it show the count of score from Jan-Mar, for Apr, it show the count of score from Feb-Apr                          and so on...

Grouped score >> IF [Score]<=6 then '0-6' ELSEIF [Score]=7 or [Score]=8 then '7-8' ELSEIF [Score]=9 or [Score]=10 then '9-10' END

As the number of sample in each month is different, so I want to show them in percentage, what should I do?

Here is my desired outcome made by Excel. • ###### 1. Re: How to create 100% stacked bar chart with calculated measures

First change the table calculation to "Percent of total" (using Quick Table Calculation). Then click on Edit Table calculation, and choose Table(down) in the compute using.

You should get the desired result.

Hope it helps.

• ###### 3. Re: How to create 100% stacked bar chart with calculated measures

1. Drag Score to the Rows column, it will show headers (since its discrete), click on the Score bullet, and Measure -> Count. Now you can see the count.

2. Now that it has turned Green (continuous) , click on the arrow again and Quick Table calculation -> Moving Average.

3. Click "Edit Table calculation" , and change the Average to Sum, prev 2, next 0.

4. Click again on the Green Score tab, Quick Table Calculation and choose "Percent of Total"

5. Edit the table calculation to move it to Pane (Down).

If you could give me a dummy dataset to work with, I can also give it a try.

Hope it helps

1 of 1 people found this helpful