1 Reply Latest reply on Nov 9, 2018 4:01 PM by Russell Goldin

    Splitting an area chart by dimension while using the same mark

    Chai Reddy

      So I' have a combination Area/Line chart that isn't stacked.

      I want to split this chart in such a way that the total of each measure stays the same but it's split by color/border based on a dimension.


      When I add the dimension to the detail view, it creates a separate area/line chart for each dimension rather than split the same mark.

      I've attached a screenshot of what I want and what's actually happening.





      What's happening:


      What I need

      tableau area.PNG



      Hope the pictures explain this confusing issue better.

      Thanks in advance.

        • 1. Re: Splitting an area chart by dimension while using the same mark
          Russell Goldin

          Hi, I have attached a TWBX that seems to solve this problem.


          Highlighting an individual Segment in my example shows that you see the breakdowns of each dimension while different dimensions are stacked against themselves (for lack of a better phrasing).






          The way it works is that each part builds upon the others.  Here is the calculation for my [Sales by Segment] calculation:

          IF [Segment] = 'Consumer'

          THEN {include [Category]:sum(if [Segment]='Consumer' then [Sales] end)}

          ELSEIF [Segment] = 'Home Office'

          THEN {include [Category]:sum(if [Segment]='Home Office' or [Segment]='Consumer' then [Sales] end)}

          ELSEif [Segment] = 'Corporate'

          THEN {include [Category]:sum(if [Segment]='Corporate' or [Segment]='Home Office' or [Segment]='Consumer' then [Sales] end)}


          The consumer segment is the sum of sales in only the consumer segment.  Then the Home Office segment is the sum of both Consumer + Home Office.  Finally, the Corporate is Consumer + Home Office + Corporate values.  This calculation should drive your axis but you’ll be able to put the original measure (in this case, Sales, on the tooltip to get the correct value.  The stacked values won’t, of course, align correctly with the axis on the chart.


          Note - This view doesn't prescribe to visual best practices and there are better ways to display the data.  But at least we now know that it's possible. 

          1 of 1 people found this helpful