A YoY (Year over Year) KPI is an indicator that compares data between two years to measure changes. It makes it possible to monitor the growth, performance or trends of an activity on an annual basis. These metrics are especially valuable for finance teams, marketing managers, and executives because they provide a clear view of how a business or project is evolving. For example, a YoY KPI can show whether your sales increased or significantly compared to the previous year. It is a simple but powerful tool for analyzing performance and identifying trends.
In this article, we'll show you how to create a YoY KPI in Tableau Desktop.
Data required
1 data table, such as the accelerator Hypermarket offered at the bottom of the Tableau Desktop login page,
1 measure, for example Sales,
2 dimensions including 1 date, such as Order Date and Category.
Instructions
Step 1: prepare the data
Create a Parameter And name it Year,
Choose the type Whole And put the second oldest year in Current value,
Please enter a Roster Of values that corresponds to Years of the data set,
Create a Calculated Field And name it Sales - Actual year,
Type the Formulates : “IF DATEPART (“year”, [Order Date]) = [Year] THEN [Sales] END”,
Click on OK,
Create a Calculated Field And name it Sales - Last Year,
Type the Formulates : “IF DATEPART (“year”, [Order Date]) = [Year] -1THEN [Sales] END”,
Click on OK
Step 2: Preparing the YoY
Create a Calculated Field And name it Sales% chg,
Type the Formulates :” (SUM ([Sales - Actual year]) -SUM ([Sales - Last Year])) /SUM ([Sales - Last Year]))))”,
Click on OK,
Create a Calculated Field And name it Sales % Chg (Neg),
Type the Formulates : “IF [Sales% chg] < 0THEN “▼” END”,
Click on OK,
Create a Calculated Field And name it Sales% chg (Pos),
Type the Formulates : “IF [Sales %chg] > 0THEN “▲"END”,
Click on OK,
Create a Calculated Field And name it Previous year,
Type the Formulates :” [Year] - 1”,
Click on OK
Step 3: Show the YoY
Drag the fields as follows:
The Sales% chg (Neg), Sales% chg (Pos) and Sales% chg fields in the Mark Text tab,
The Previous Year and Sales - Actual Year fields in the guide tooltip tab,
Format the content of the label.
Step 4: Building a YoY KPI
In a new SheetDrag the Field Sales In the Tab Etiquette coordinate system and format the view,
In a final SheetDrag the Field Order date In the Columns And the field Sales In the Lines, then format the view,
Add the 3 sheets in Horizontal and vertical containers In Your Scorecard,
Adjust according to your preferences.
Step 5: Integrate the KPI into your dashboard
Add the 3 sheets in Horizontal and vertical containers In Your Scorecard,
Adjust according to your preferences.
Tips
Add arrows (↑ or ↓) and use colors (green for up, red for down) to render information Easy to understand At a glance.
Show current values, previous year values, and percentage change for comparison Complete and Clear.
Simplify reading by using abbreviations for large values (e.g. €1.2M) and by ensuring that your KPIs are Legible and Well Presented.