0
0
Tableaubi_tool~15 mins

Difference and percent difference 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 how monthly sales have changed compared to the previous month, both in absolute terms and as a percentage.
📊 Data: You have monthly sales data for the past year, including the month and total sales amount.
🎯 Deliverable: Create a Tableau dashboard showing monthly sales, the difference in sales from the previous month, and the percent difference from the previous month.
Progress0 / 7 steps
Sample Data
MonthSales
Jan10000
Feb12000
Mar9000
Apr15000
May14000
Jun16000
Jul17000
Aug16500
Sep18000
Oct19000
Nov20000
Dec21000
1
Step 1: Connect your Tableau workbook to the sales data source containing Month and Sales columns.
No formula needed; just connect and load data.
Expected Result
Data is loaded and visible in Tableau's data pane.
2
Step 2: Create a calculated field named 'Sales Difference' to find the difference in sales compared to the previous month.
ZN(SUM([Sales])) - LOOKUP(ZN(SUM([Sales])), -1)
Expected Result
For February, Sales Difference = 12000 - 10000 = 2000; for March, = 9000 - 12000 = -3000, etc.
3
Step 3: Create a calculated field named 'Percent Difference' to find the percent change in sales compared to the previous month.
(ZN(SUM([Sales])) - LOOKUP(ZN(SUM([Sales])), -1)) / ABS(LOOKUP(ZN(SUM([Sales])), -1))
Expected Result
For February, Percent Difference = (12000-10000)/10000 = 0.20 (20%); for March, = (9000-12000)/12000 = -0.25 (-25%), etc.
4
Step 4: Build a line chart with Month on Columns and SUM(Sales) on Rows to show monthly sales trend.
Drag 'Month' to Columns shelf, drag 'Sales' to Rows shelf, set aggregation to SUM.
Expected Result
Line chart showing sales trend from January to December.
5
Step 5: Add 'Sales Difference' and 'Percent Difference' as labels or tooltips on the line chart for each month.
Drag 'Sales Difference' and 'Percent Difference' calculated fields to Tooltip shelf or Label shelf.
Expected Result
When hovering over each month, the difference and percent difference from the previous month are visible.
6
Step 6: Format 'Percent Difference' to show as percentage with one decimal place.
Right-click 'Percent Difference' field, select Default Properties > Number Format > Percentage, 1 decimal place.
Expected Result
Percent differences display as 20.0%, -25.0%, etc.
7
Step 7: Create a dashboard combining the line chart and a text summary explaining the sales changes month to month.
Use Tableau dashboard interface to add the chart and a text box with summary.
Expected Result
Dashboard shows sales trend line chart with difference and percent difference details and a clear summary.
Final Result
Monthly Sales Trend

Month | Sales  | Diff from Prev | % Diff from Prev
---------------------------------------------------
Jan   | 10000  | N/A            | N/A
Feb   | 12000  | 2000           | 20.0%
Mar   | 9000   | -3000          | -25.0%
Apr   | 15000  | 6000           | 66.7%
May   | 14000  | -1000          | -6.7%
Jun   | 16000  | 2000           | 14.3%
Jul   | 17000  | 1000           | 6.3%
Aug   | 16500  | -500           | -2.9%
Sep   | 18000  | 1500           | 9.1%
Oct   | 19000  | 1000           | 5.6%
Nov   | 20000  | 1000           | 5.3%
Dec   | 21000  | 1000           | 5.0%

(Line chart shows sales rising and falling month to month with labels for difference and percent difference)
Sales increased significantly in April compared to March (+66.7%).
March saw a drop in sales compared to February (-25%).
Overall, sales trend is upward from January to December with some fluctuations.
Percent difference helps quickly see the size of changes relative to previous month.
Bonus Challenge

Add a filter to the dashboard to select different years and see monthly sales differences for each year.

Show Hint
Add a Year field to your data source and use it as a filter on the dashboard. Adjust calculated fields to consider year context.