4 Replies Latest reply on Sep 28, 2018 1:19 AM by Chandana Kollu

# Percentage on Stacked bars with Department sales on the Y-Axis and Tiers on the X-Axis.

Hi Guys,

I need some help in Tableau visualizations.

We need to make a visualization in Tableau with the scenario explained below:

Scenario: We have 4 metrics: Sales Department A, Sales Department B, Sales Department C and Sales Department D (These are all independent metrics used to fetch data from a large database).

We need to present sales data Tier-wise in the form of a stacked chart as per the attached image (Tableau Query Pic.png)

Now the problem is to have the percentages as Labels on the bars as per the below calculation:

Eg: Percentage sales of Department A in Tier 1 = (Sales of Department A in Tier 1/ Total sales in Tier 1)*100.

We need to have Sales on the Y-axis and Tiers on the X-axis.

Please find enclosed the sample data for this chart. (Tableau Query.xlsx). I am using Tableau Desktop 10.3

In addition, i have tried the annotate feature but it doesnt work as expected as the position of labels is static.

Best regards,

Gitesh Goyal.

• ###### 1. Re: Percentage on Stacked bars with Department sales on the Y-Axis and Tiers on the X-Axis.

Hi Gitesh,

Measure names --> Filter --> Unselect "Number of Records"

measure values to rows

Department to legend

hope this helps

BR,

NB

• ###### 2. Re: Percentage on Stacked bars with Department sales on the Y-Axis and Tiers on the X-Axis.

Hi Naveen,

I have reached out to this part but the problem is to have the percentages as Labels on the bars as per the below calculation:

Eg: Percentage sales of Department A in Tier 1 = (Sales of Department A in Tier 1/ Total sales in Tier 1)*100.

Best regards,

Gitesh.

• ###### 3. Re: Percentage on Stacked bars with Department sales on the Y-Axis and Tiers on the X-Axis.

HI Gitesh,

I got the chart which you needed

Tried using calculated field .Pls check and let me know .

KIndly check it ..

1 of 1 people found this helpful
• ###### 4. Re: Percentage on Stacked bars with Department sales on the Y-Axis and Tiers on the X-Axis.

Gitesh Goyal

I have added table calculation for all the measures

pecentage of total and table across.

I think this is what you needed .Kindly check

1 of 1 people found this helpful