Thanks. That doesn't seem to do what I need (although I did learn something new, which I am happy about). I appreciate your help and time. I am very new to Tableau and this system has it's only unique quirks, that I haven't experienced in other systems, which I don't yet have my head around.
When I did what you said, I just got 12 months plotted on the graph, with sales for that month only in each column. I want to plot 24 months (obviously that would be just changing the relative filter to 24 instead), but with each column, I need the data to be dynamic and sum up a full year of sales, not just give me the sales that occurred in the actual month.
For example the last 5 months of columns would have the aggregate total for the following:
Jun (Jul 2017 to Jun 2018 Data)
Jul (Aug 2017 to Jul 2018 Data)
Aug (Sep 2017 to Aug 2018 Data)
Sep (Oct 2017 to Sep 2018 Data)
Oct (Nov 2017 to Oct 2018 Data)
There's only way I could think of, using a Parameter. Here's how to do it,
1) Select Create Parameter
2) Then give it a name, select data type, select Range, Set From Field and load values from your date field, finally set the step size to 1 month, so you get increments of 1 month.
4) Give the calc field a name, and type in this formula,
5) Now you place this calc field in filters card and select 1. (convert this dimension first.)
6) Then Date in Columns, Sales in Text, Show Parameter and done.
Note: Parameters are static, which means every time you have new data flowing in you'll have to update the parameter accordingly. However, if you're on 2018.2, it comes with Extensions which enables you to use dynamic parameters.
Hope this helps.
Loretta_TC_v10.2.twbx 2.3 MB
You can use the parameter to get the desired result. Follow these step
create a parameter and name "Number of months"
then again create a parameter name "Select date"
then create two calculate field and place it to filter shelf and select true
Right-click the Number of months and Select date parameter and show parameter control.
Number of Months - parameter will allow selecting the desired number of months
Select date - parameter will allow you to select the month to back as desired months.
I have attached a workbook for your reference.
Loretta Antonino - pease mark this answer is "Correct answer" if it solves your problem
Table Calculation -.twbx 427.4 KB