Skip to main content
Shubhangi Jadhav ha fatto una domanda in #Tableau Public

 

Here in this bar chart, i have plotted total admissions against age groups. The admissions is a calculated field derived from female count + male count. Now I want a stacked bar chart with distinct colors for female and male count/percentage. How can I do that?

How to put up a stacked bar chart

 

 

 

#Tableau Public

1 risposta
  1. 29 set, 15:25

    @Shubhangi Jadhav

     you'll want to Pivot your data in the data source tab (1st tab of every workbook). 

     

    Go to the data source tab, select Male/Female columns, then right-click and from the menu of options, select Pivot:

    you'll want to Pivot your data in the data source tab (1st tab of every workbook).From there, you'll then see Tableau represents the data as Pivot Field Names and Pivot Field Values (you can click into the header and rename these):Screenshot 2026-09-29 at 8.20.38 AM.png

     

    Then you can build your view: 

     

    Screenshot 2026-09-29 at 8.22.19 AM.png

    To get the percentage of same, drag another SUM( [Gender Counts] ) as example field.  Then right-click and select Quick Table Calculation, then from sub-menu to that, select Percent of Total.   

     

    Screenshot 2026-09-29 at 8.57.31 AM.png

     

    Then set the compute by to use Table Across:

     

    Screenshot 2026-09-29 at 8.57.58 AM.png

    You'll then have what you've asked for in your post: 

     

    Screenshot 2026-09-29 at 8.58.06 AM.png

    If this response answered your question, please mark it as an Accepted Answer? 

    This way, others searching for similar solutions will find the answer faster in the future.

    Best, Don Wise (Tableau Ambassador)

0/9000