0
0
Tableaubi_tool~15 mins

Relative date filtering in Tableau - Real Business Scenario

Choose your learning style9 modes available
Scenario Mode
👤 Your Role: You are a sales analyst at a retail company.
📋 Request: Your manager wants to see the sales performance for the last 3 months compared to the same period last year. They want a dashboard that automatically updates to always show the most recent 3 months of data.
📊 Data: You have a sales dataset with columns: Order Date, Sales Amount, Region, and Product Category. The data covers multiple years.
🎯 Deliverable: Create a Tableau dashboard with a line chart showing monthly sales for the last 3 months and the same 3 months last year, using relative date filtering to keep the data current.
Progress0 / 8 steps
Sample Data
Order DateSales AmountRegionProduct Category
2023-03-151200EastElectronics
2023-04-101500WestFurniture
2023-05-051700EastElectronics
2022-03-201100EastElectronics
2022-04-151400WestFurniture
2022-05-101600EastElectronics
2023-01-25900SouthOffice Supplies
2023-02-141000NorthFurniture
2022-01-30850SouthOffice Supplies
2022-02-18950NorthFurniture
1
Step 1: Connect your sales data to Tableau and open a new worksheet.
No formula needed.
Expected Result
Data is loaded and ready for analysis.
2
Step 2: Create a calculated field to extract the month and year from Order Date for grouping.
Create calculated field named 'Month Year' with formula: DATETRUNC('month', [Order Date])
Expected Result
A new field 'Month Year' that groups dates by month and year.
3
Step 3: Drag 'Month Year' to Columns and 'SUM(Sales Amount)' to Rows to create a line chart of monthly sales.
No formula needed.
Expected Result
Line chart showing total sales per month.
4
Step 4: Add a relative date filter on 'Order Date' to show only the last 3 months.
Right-click 'Order Date' > Filter > Relative Date > Select 'Months' and 'Last 3 months'.
Expected Result
Chart updates to show sales data only for the last 3 months.
5
Step 5: Duplicate the worksheet to create a comparison for the same 3 months last year.
No formula needed.
Expected Result
Second worksheet ready for last year data.
6
Step 6: On the duplicated worksheet, edit the relative date filter to show the same 3 months but for last year.
Right-click 'Order Date' > Filter > Relative Date > Select 'Months' and 'Last 3 months' > Check 'Previous Year'.
Expected Result
Chart shows sales data for the same 3 months last year.
7
Step 7: Create a dashboard and add both worksheets side by side with clear titles: 'Last 3 Months Sales' and 'Same Period Last Year'.
No formula needed.
Expected Result
Dashboard displays two line charts for easy comparison.
8
Step 8: Test the dashboard by changing the system date or refreshing data to confirm the relative date filters update automatically.
No formula needed.
Expected Result
Dashboard always shows the most recent 3 months and the same period last year without manual changes.
Final Result
Dashboard: Relative Date Sales Comparison

+-------------------------+  +------------------------------+
| Last 3 Months Sales      |  | Same Period Last Year Sales   |
|                         |  |                              |
|  *---*---*---*---*---*  |  |  *---*---*---*---*---*---*   |
|  |   |   |   |   |   |  |  |  |   |   |   |   |   |   |   |
|  |   |   |   |   |   |  |  |  |   |   |   |   |   |   |   |
|  *---*---*---*---*---*  |  |  *---*---*---*---*---*---*   |
|  Mar  Apr  May           |  |  Mar  Apr  May                |
+-------------------------+  +------------------------------+
Sales in the last 3 months show an increasing trend.
Compared to the same period last year, sales have grown by approximately 10%.
The relative date filter keeps the dashboard updated automatically.
Bonus Challenge

Add a filter to the dashboard that allows the manager to select different time ranges like last 6 months or last year dynamically.

Show Hint
Use Tableau's relative date filter with 'Range of dates' option and add it as a dashboard filter control.