Reputation: 43
Before I began, I apologize in advanced for my poor english. I have a bar chart listing the profits by months for the fiscal year of 2008 and 2009. What I would like to do is have tableau calculate the total average of the 2008 fiscal year(from October to September) and shows it as a single bar but still show the month by month profit fiscal year for 2009. How would I go about doing so? thanks
https://i.sstatic.net/xjZYE.png
Upvotes: 1
Views: 1120
Reputation: 2275
Create a calculated field
IF YEAR(date) = 2008
THEN [1/1/2008]
ELSE date
END
Where [1/1/2008] can be either a date parameter set to 1/1/2008 (my favorite approach), or you can try to do something that makes Tableau understand it is a date, and it is 1/1/2008.
Now use that field.
But there are limitations. If your data is in a more granular level (like per day, or even per transaction), you can't just average the numbers.
Tableau 9 can help you in that. Using the brand new Level of Detail calculation, you can calculate the sum of each month, and then average it. I still don't have it ready, but should be something like:
{ FIXED DATETRUNC('month',date): SUM(profit) }
And then you can try to average this new field.
Note: I can't be sure this will work perfectly. As soon as I have Tableau 9 in my hands I'll test.
Upvotes: 0