Skip to main content

I have a workbook (attached). I am trying to get totals for each stacked bar. I've tried a number of solutions shared here but must be doing something wrong. Can someone advise on what I'm missing? When I do a reference Line for Average it works great. When I do a reference line for Minimum it works great. You can see I've added reference lines for both. When I do one for Sum it is adding up all the values, not the values by Month. What am I missing? Thanks for the help. I updated this original post with a twbx file....still a newbie :-)

6 answers
  1. Jul 2, 2023, 1:29 PM

    Agree with @Ayinde Hammed​ here on methodology if you need to keep your data structure as is.

     

    The primary reason you're struggling with this is the shape of the underlying data. They're each individual measures. If the data were pivoted (select all 3 columns for Item 1 - 3 in the Data Source Tab/Pane, then right-click, select Pivot from list of options) then you'd see better/easier results. By creating a Pivot, Tableau will create two new columns Pivot Field Names and Pivot Field Values. You can always rename those.

    Agree with @Ayinde Hammed​ here on methodology if you need to keep your data structure as is. The primary reason you're struggling with this is the shape of the underlying data.Screen Shot 2023-07-02 at 6.17.22 AMThen build your view:

    Screen Shot 2023-07-02 at 6.19.57 AMBefore doing the below, change your Date from Continuous to Discrete. Then add in your new reference line per cell, using Total:

    Screen Shot 2023-07-02 at 6.24.15 AMYou should then have (with a little additional formatting on your reference line):

    Screen Shot 2023-07-02 at 6.24.22 AM

     

    Best, Don

    (Please, don't forget to click Select as Best or Upvote !)

0/9000