Tableau desktop average line granularity error

187 Views Asked by At

[14 day sales trend,split by student type][1] I was trying to plot an average line for the sales over the past 14 days. I have used average line in analytics pane for the entire table. And I have made bar chart to stacked bar chart by splitting the sales on each day with old/new student types. The average line was at ~470 when I tried without adding student type to "color" in marks card. The average line moved to 235 when I have added student type to "color" however the tooltip is showing ~470. The granularity level tableau taking is the student type but I need it at the day level. What change should I make to bring back the average line to the correct value i.e., 470 showing the student type details too.?

1

There are 1 best solutions below

2
Fosstin On

Two points:

  1. As you stated, you have configured the average line to be calculated across the whole table, which should result in the average line calculation ignoring any more granular levels of detail. Since your line is moving as you add more dimensions to the view, this behavior indicates that you may have configured your average line to display AVG(Sales) Average, instead of SUM(Sales) Average. Right-click the average line and choose Edit. Then, change the Value selectors to SUM(Sales) Average.

  2. When you add an average line from the analytics pane, this metric does not automatically also get added to the tooltip. So, comparing the value of the average line to what you have in the tooltip is likely not a valid, "apples to apples" comparison. Check to see if you may have added AVG(Sales) somewhere else in the view in addition to adding the average line from the analytics pane.