4 Replies Latest reply on Sep 7, 2018 7:22 AM by Aaron Dobbins

# Stacked Bar Chart showing Commodity as a % of the total for the month

The \$39.4M makes up 40% of my total spend in October 17 and the \$39.9M makes up 41% of my total Spend in November of 17.  I want to create a stacked bar chart for each month showing how much of each commodity listed below makes up of the percentage by month.  So in October, the total of the stacked bars should equal 40% in November the total should equal 41% etc.  Does anyone have a suggestion?

• ###### 1. Re: Stacked Bar Chart showing Commodity as a % of the total for the month

Any ideas on this?

• ###### 2. Re: Stacked Bar Chart showing Commodity as a % of the total for the month

For the two data sources being used, can they be combined somewhere before blending in Tableau?  For the stacked bar chart to work properly you need to be able to calculate LCC per Commodity, use that value in Rows, then put the Commodity name on color.  The problem is because there are two data sources you can't use an LOD.

I can't check if this is correct because I can't connect to your data sources even with the packaged workbook for some reason.

CF on ExternalSpend Data Source: Total External Spend (gives you total external spend by period)

{ FIXED [Period Date] : SUM(ExternalSpend.ActualSpend) }

CF on Enterprise_LCC: LCC by Commodity (should give you % of spend by commodity as long as Commodity pill is on detail or color in the bar chart)

SUM([Actual Spend]) / SUM([ExternalSpend (SC.ExternalSpend)+ (BEdrock_Views)].[Total External Spend by Period])

Drop the LCC by Commodity value in Rows and see if the stacked bar calculates correctly.

• ###### 3. Re: Stacked Bar Chart showing Commodity as a % of the total for the month

Aaron, that works without being able to combine the data sources.  I was trying to use LOD and quickly learned that they do not work with more than one data source.  Thank you very much for your help!

• ###### 4. Re: Stacked Bar Chart showing Commodity as a % of the total for the month

Great!  Glad it worked out!  I haven't worked with too many dashboards that have multiple data sources I needed to combine yet so learning LODs don't work across multiple sources was news to me!