0
0
Tableaubi_tool~15 mins

Context filters 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 analyze sales performance for the top 3 product categories by sales revenue in the last year. They want to see monthly sales trends only for these top categories.
📊 Data: You have sales data including Order Date, Product Category, Sales Revenue, and Quantity Sold for the past two years.
🎯 Deliverable: Create a Tableau dashboard showing monthly sales trends for the top 3 product categories by sales revenue in the last year using context filters.
Progress0 / 6 steps
Sample Data
Order DateProduct CategorySales RevenueQuantity Sold
2023-01-15Electronics12005
2023-01-20Furniture8003
2023-02-10Office Supplies40010
2023-02-15Electronics15007
2023-03-05Furniture9004
2023-03-10Office Supplies45012
2023-04-12Electronics13006
2023-04-18Furniture8503
2023-05-20Office Supplies50015
2023-05-25Electronics14007
2023-06-15Furniture9505
2023-06-20Office Supplies48014
1
Step 1: Connect your sales data source to Tableau and load the data.
No formula needed; just connect and import the data.
Expected Result
Sales data with Order Date, Product Category, Sales Revenue, and Quantity Sold is loaded into Tableau.
2
Step 2: Create a calculated field to extract the year from Order Date to filter last year's data.
YEAR([Order Date])
Expected Result
A new field 'Year' is available to filter data for the last year (2023).
3
Step 3: Apply a filter on 'Year' to include only 2023 data.
Filter: Year = 2023
Expected Result
Data is filtered to only include sales from the year 2023.
4
Step 4: Create a context filter on Product Category to keep only the top 3 categories by total sales revenue in 2023.
Right-click Product Category filter > Add to Context > Set filter to Top 3 by SUM([Sales Revenue])
Expected Result
Context filter applied; only top 3 product categories by sales revenue in 2023 are included in further analysis.
5
Step 5: Create a line chart with Order Date (month) on Columns and SUM(Sales Revenue) on Rows, colored by Product Category.
Columns: MONTH([Order Date]) Rows: SUM([Sales Revenue]) Color: Product Category
Expected Result
Line chart shows monthly sales trends for the top 3 product categories in 2023.
6
Step 6: Build a dashboard and add the line chart. Add filters for Year and Product Category with context filter applied.
Drag worksheet to dashboard; add Year and Product Category filters; ensure Product Category filter is context filter.
Expected Result
Dashboard displays monthly sales trends for top 3 categories with filters working correctly.
Final Result
Monthly Sales Trends Dashboard

+------------------------------------------------+
| Month | Electronics | Furniture | Office Supplies |
|------------------------------------------------|
| Jan   | 1200       | 800       | 0              |
| Feb   | 1500       | 0         | 400            |
| Mar   | 0          | 900       | 450            |
| Apr   | 1300       | 850       | 0              |
| May   | 1400       | 0         | 500            |
| Jun   | 0          | 950       | 480            |
+------------------------------------------------+

(Line chart with lines for each category showing trends over months)
Electronics, Furniture, and Office Supplies are the top 3 product categories by sales revenue in 2023.
Electronics shows strong sales in January, February, April, and May.
Furniture sales peak in March and June.
Office Supplies have steady sales in February, March, May, and June.
Bonus Challenge

Add a parameter to let users select how many top product categories to analyze (e.g., top 2, top 3, top 5) and update the context filter dynamically.

Show Hint
Create a parameter for number of top categories, then use a calculated field with RANK() function on SUM([Sales Revenue]) to filter categories based on the parameter value.