How to Create KPIs in Tableau
Tracking Key Performance Indicators (KPIs) in Tableau provides an instant, visual snapshot of your business health. Instead of digging through rows of data, you can build clear, compelling KPI dashboards that tell you immediately if you're hitting your goals. This article will walk you through exactly how to create and visualize KPIs in Tableau using calculated fields to track performance against targets.
What is a KPI in Tableau?
In business, a KPI is a measurable value that shows how effectively your team or company is achieving its main objectives. A great KPI is specific, measurable, and directly tied to a strategic goal. It tells a story about your performance.
In Tableau, a KPI isn't a specific, pre-built feature but rather a method of visualizing data. It typically involves three core components:
- A Primary Metric: The actual value you are measuring (e.g., quarterly sales, website sessions, new customers).
- A Target Value: The goal or benchmark you are measuring against (e.g., sales target, session goal).
- A Visual Indicator: A quick visual cue, like color or an icon, to show performance status (e.g., green for above target, red for below target).
By bringing these elements together on a worksheet or dashboard, you can build a KPI that does more than just show a number, it provides instant context about how that number stacks up against your expectations.
Gathering Your Data for KPI Tracking
Before you start building in Tableau, your data needs to be structured properly. For most KPIs, you'll need at least two essential fields in your dataset:
- An Actual Value: A column containing the numbers you're currently achieving. For example, a
Salescolumn summing up revenue generated. - A Target Value: A corresponding column with the goals for that same metric. For example, a
Sales Targetcolumn.
Your dataset might look something like this, whether in an Excel file, a Google Sheet, or a database table:
Step-by-Step: Creating a Basic KPI in Tableau
Let's use the sales data example above to build a KPI card that shows whether sales are above or below the target. This process relies heavily on Calculated Fields to create the logic for your visual indicators.
Step 1: Create a Calculated Field for Variance
First, we want to know the difference between our actual sales and our sales target. This is called the variance. A positive variance means we’re over target, and a negative variance means we're under.
- Go to the Analysis menu at the top, and select Create Calculated Field.
- Name the field something clear, like "Sales Variance".
- Enter the formula to subtract the target from the actual sales:
SUM([Sales]) - SUM([Sales Target])This simple formula calculates the total difference. Click OK to save the calculated field. You’ll now see "Sales Variance" in your data pane, ready to use.
Step 2: Create a Calculated Field for KPI Status
Next, we need to create the logic that will drive our colors and shapes. This calculated field will return a text label describing the performance status - like "Above Target" or "Below Target."
- Create another calculated field and name it "KPI Status".
- Use an IF statement to check if the sales are greater than, less than, or equal to the target:
IF SUM([Sales]) > SUM([Sales Target]) THEN
"Above Target"
ELSEIF SUM([Sales]) < SUM([Sales Target]) THEN
"Below Target"
ELSE
"On Target"
ENDThis code checks the performance and returns one of three simple strings. Click OK to save it. We'll use this field to tell Tableau which colors and shapes to show.
Step 3: Build the Visualization
Now that our logic is built, we can assemble the KPI view.
- Drag your main metric, Sales, onto the Text mark on the Marks card. This will display the total sales number.
- Drag your Sales Variance calculated field onto the Text mark as well. You now have both the total sales and the variance shown.
- Drag your KPI Status calculated field onto the Color mark. Tableau will automatically assign different colors to "Above Target," "Below Target," and "On Target." You can edit these colors by clicking the Color mark.
- Drag the KPI Status field onto the Shape mark as well. Tableau will assign default shapes.
Your worksheet now shows a number for sales and variance, along with a colored shape indicating performance. It’s a functional KPI, but we can make it look much more professional.
Improving Your Tableau KPI Visuals
A good KPI dashboard communicates information with just a glance. Here are a few tips to make your KPI card more intuitive and visually appealing.
Tip 1: Use Custom Shapes for Clearer Indicators
The default shapes (squares, circles) work, but custom shapes like up and down arrows are far more universally understood.
- Click on the Shape mark on your Marks card.
- In the dialog box, select your status (e.g., "Above Target"). From the Shape Palette dropdown, pick Shapes.
- Assign a custom shape. There is an "Arrows" palette built into Tableau. Assign an up arrow for "Above Target" and a down arrow for "Below Target." An empty circle or a right-facing arrow often works well for "On Target."
Tip 2: Customize Colors for Immediate Recognition
Color is a powerful visual cue. Stick to conventions that people already understand without needing to think: green often means good, and red often means bad.
- Click the Color mark to edit your colors.
- Assign a shade of green to "Above Target," a shade of red to "Below Target," and a neutral color like gray or light blue to "On Target."
- Pro Tip: Be mindful of colorblindness. Combining color with shapes (like green/up arrow and red/down arrow) makes your dashboard more accessible to everyone.
Tip 3: Format the Text for Emphasis
Create a clear visual hierarchy by formatting your text. The most important number should be the biggest and boldest.
- Click on the Text mark.
- Click the three dots (...) to open the text editor.
- Here, you can arrange your fields and change their fonts, sizes, and colors. Try making the
SUM(Sales)number large and bold, and place theSales Variancetext below it in a smaller, lighter font. This creates a clean, professional-looking KPI card that's easy to read.
Creating a KPI Dashboard in Tableau
The real power of KPIs in Tableau comes alive on a dashboard, where you can display multiple KPIs side-by-side to give a complete overview of business performance.
Layout Multiple KPI Cards
- Create a new Dashboard.
- Drag each of your KPI worksheets onto the dashboard canvas.
- Use Horizontal and Vertical layout containers to organize your KPI cards neatly at the top of your dashboard. This creates a "banner" or "header" section of at-a-glance metrics.
Add Trend Lines for Context
A standalone number can be misleading. Is $55,000 in sales good? It's better than the $50,000 target, but what if last month’s sales were $70,000? Adding a trend line provides vital context.
- Create a new worksheet.
- Place your date field (e.g., Month) on the Columns shelf.
- Place your core metric (e.g., SUM(Sales)) on the Rows shelf.
- Format this simple line chart to be small and clean (hide axes, remove titles). This is often called a sparkline.
- On your dashboard, place this sparkline worksheet underneath or next to its corresponding KPI card to show the trend direction over time.
Mistakes to Avoid When Building KPIs
Cluttering Your Dashboard with "Vanity Metrics"
More is not always better. Resist the temptation to track every possible metric. A cluttered dashboard with dozens of KPIs can lead to confusion. Focus only on the metrics that are directly tied to your most important business goals and that will prompt action.
Ignoring the Importance of Context
A number without a target is just data, not an indicator of performance. Always display your KPIs alongside their goals, their variance, or their trends over time. This context is what transforms a number into an insight.
Using Unclear or Complicated Visuals
The goal of a KPI is rapid comprehension. Avoid using complex chart types or confusing color schemes. Simple text, clean icons, and logical colors (green/red) are your best friends when displaying headline performance indicators. Stick with what's intuitive and easy to digest in seconds.
Final Thoughts
Creating effective KPIs in Tableau is all about transforming raw numbers into a clear story about your business performance. By pairing actuals with targets, creating smart calculated fields, and using simple visual cues like colors and shapes, you can build dashboards that empower your team to make faster, more informed decisions.
While building dashboards in Tableau is an incredibly powerful skill, it requires a significant amount of configuration to create calculated fields and dial in the visuals. At Graphed , we’ve taken a different approach to solve this. Instead of having to learn a complex tool or write formulas, you can just ask questions in plain English - like "Show me a dashboard of sales vs. target for each region Q1" - and we instantly build the real-time dashboard for you, connected directly to your underlying data sources. It lets your whole team get insights without anyone needing to become a dashboard specialist.
Related Articles
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.
How to Create a Photo Album in Meta Business Suite
How to create a photo album in Meta Business Suite — step-by-step guide to organizing Facebook and Instagram photos into albums for your business page.