[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 Answers
Two points:
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.
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.

- 141
- 4
-
Thanks. 1) But I have used sum(sales) average. I have just checked it. When it is just a bar chart the average line is at 470. When i pulled student type to color and converted it to a stacked bar average line moved to 235. 2) In edit option I have customized the label and tool tip to show
, why does it show 470 on tooltip and 235 on average line. I am unable to add a snapshot of it, as I'm new to stackoverflow. Will keep it soon. – Rajkumar Shenigaram Oct 24 '21 at 04:50 -
Post your question to the Tableau Community Forum (https://community.tableau.com/s/explore-forums). There you can post your example workbook or screenshots. – Fosstin Oct 25 '21 at 13:47