Dashboard Mode - Difference and percent difference
Business Question
How have sales changed from the previous month? Show both the difference and the percent difference.
Jump into concepts and practice - no test required
How have sales changed from the previous month? Show both the difference and the percent difference.
| Month | Sales |
|---|---|
| January | 1000 |
| February | 1200 |
| March | 900 |
| April | 1500 |
| May | 1300 |
| June | 1600 |
SUM([Sales]) filtered by selected monthSUM([Sales]) - LOOKUP(SUM([Sales]), -1)(SUM([Sales]) - LOOKUP(SUM([Sales]), -1)) / LOOKUP(SUM([Sales]), -1)+--------------------------------------------------+ | Total Sales Current Month | Difference | % Diff | | [KPI Card] | [KPI Card] | [KPI] | +--------------------------------------------------+ | | | Sales Over Months | | [Line Chart] | | | +--------------------------------------------------+ | | | Monthly Sales Table with Difference Columns | | [Data Table] | | | +--------------------------------------------------+
User selects a month from a filter dropdown. The KPI cards update to show sales, difference, and percent difference for that month. The line chart highlights the selected month. The table shows all months with their sales and differences, but the selected month is emphasized.
If you add a filter to select the month "May", which components update and what values do they show?
Difference calculation in Tableau typically show?LOOKUP(SUM([Sales]), 0) - LOOKUP(SUM([Sales]), -1)(SUM([Sales]) - LOOKUP(SUM([Sales]), -1)) / SUM([Sales])(SUM([Sales]) - LOOKUP(SUM([Sales]), -1)) / NULLIF(LOOKUP(SUM([Sales]), -1), 0) to avoid division by zero uses NULLIF to prevent errors; others either divide by current or ignore zero sales causing errors or wrong results.