0
0
Tableaubi_tool~15 mins

Rank calculations 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 which products are the top sellers each month and how they rank compared to others.
📊 Data: You have monthly sales data with columns: Month, Product, and Sales Amount.
🎯 Deliverable: Create a report that shows each product's sales per month and their rank within that month based on sales.
Progress0 / 6 steps
Sample Data
MonthProductSales Amount
JanuaryProduct A5000
JanuaryProduct B7000
JanuaryProduct C3000
FebruaryProduct A6000
FebruaryProduct B4000
FebruaryProduct C8000
MarchProduct A7000
MarchProduct B9000
MarchProduct C5000
1
Step 1: Connect your data source in Tableau and load the sales data.
No formula needed; just connect and import the data.
Expected Result
Data is loaded and visible in Tableau's Data pane.
2
Step 2: Create a worksheet to display sales by Month and Product.
Drag 'Month' to Columns, 'Product' to Rows, and 'Sales Amount' to Text on Marks card.
Expected Result
A table showing sales amounts for each product by month.
3
Step 3: Create a calculated field to rank products by sales within each month.
Create calculated field named 'Sales Rank' with formula: RANK_UNIQUE(SUM([Sales Amount]), 'desc')
Expected Result
A new field 'Sales Rank' that assigns a unique rank to each product's sales within the current partition.
4
Step 4: Set the partitioning for the rank calculation to be by Month.
Edit table calculation for 'Sales Rank': Compute Using 'Product', Restarting every 'Month'.
Expected Result
Ranking resets for each month, ranking products only within that month.
5
Step 5: Add the 'Sales Rank' calculated field to the worksheet next to sales amounts.
Drag 'Sales Rank' to Text or next to 'Sales Amount' in the view.
Expected Result
The table now shows sales amounts and the rank of each product per month.
6
Step 6: Format the worksheet for clarity: sort products by rank ascending within each month.
Sort 'Product' by 'Sales Rank' ascending within each month.
Expected Result
Products appear ordered by their sales rank for each month.
Final Result
Month    | Product   | Sales Amount | Sales Rank
----------------------------------------------
January  | Product B | 7000         | 1
January  | Product A | 5000         | 2
January  | Product C | 3000         | 3

February | Product C | 8000         | 1
February | Product A | 6000         | 2
February | Product B | 4000         | 3

March    | Product B | 9000         | 1
March    | Product A | 7000         | 2
March    | Product C | 5000         | 3
Product B was the top seller in January and March.
Product C led sales in February.
Ranking helps quickly identify the best and worst performing products each month.
Bonus Challenge

Create a dashboard that shows monthly sales trends and ranks for products with a filter to select a specific product.

Show Hint
Use a parameter or filter control for product selection and combine line charts for sales trends with rank tables.