How to build a YoY indicator in Tableau?

Preparation time : 15 minutes

Level : Expert

Objective: Building a YoY

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. 1 data table, such as the accelerator Hypermarket offered at the bottom of the Tableau Desktop login page,
  2. 1 measure, for example Sales,
  3. 2 dimensions including 1 date, such as Order Date and Category.

Instructions

Step 1: prepare the data

  1. Create a Parameter And name it Year,
    1. Choose the type Whole And put the second oldest year in Current value,
    2. Please enter a Roster Of values that corresponds to Years of the data set,
  2. Create a Calculated Field And name it Sales - Actual year,
    1. Type the Formulates : “IF DATEPART (“year”, [Order Date]) = [Year] THEN [Sales] END”,
    2. Click on OK,
  3. Create a Calculated Field And name it Sales - Last Year,
    1. Type the Formulates : “IF DATEPART (“year”, [Order Date]) = [Year] -1THEN [Sales] END”,
    2. Click on OK

Step 2: Preparing the YoY

  1. Create a Calculated Field And name it Sales% chg,
    1. Type the Formulates :” (SUM ([Sales - Actual year]) -SUM ([Sales - Last Year])) /SUM ([Sales - Last Year]))))”,
    2. Click on OK,
  2. Create a Calculated Field And name it Sales % Chg (Neg),
    1. Type the Formulates : “IF [Sales% chg] < 0THEN “▼” END”,
    2. Click on OK,
  3. Create a Calculated Field And name it Sales% chg (Pos),
    1. Type the Formulates : “IF [Sales %chg] > 0THEN “▲"END”,
    2. Click on OK,
  4. Create a Calculated Field And name it Previous year,
    1. Type the Formulates :” [Year] - 1”,
    2. Click on OK

Step 3: Show the YoY

  1. Drag the fields as follows:
    1. The Sales% chg (Neg), Sales% chg (Pos) and Sales% chg fields in the Mark Text tab,
    2. The Previous Year and Sales - Actual Year fields in the guide tooltip tab,
  2. Format the content of the label.

Step 4: Building a YoY KPI

  1. In a new SheetDrag the Field Sales In the Tab Etiquette coordinate system and format the view,
  2. In a final SheetDrag the Field Order date In the Columns And the field Sales In the Lines, then format the view,
  3. Add the 3 sheets in Horizontal and vertical containers In Your Scorecard,
  4. Adjust according to your preferences.

Step 5: Integrate the KPI into your dashboard

  1. Add the 3 sheets in Horizontal and vertical containers In Your Scorecard,
  2. 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.