How to Make KPI Cards in Tableau
KPI cards are the first thing you see on a great dashboard - big, clear numbers that tell you instantly what's going on. They turn complex data into at-a-glance insights. This guide will walk you through exactly how to build these essential KPI cards in Tableau, from a simple single metric to a more dynamic card showing period-over-period growth.
What Are KPI Cards and Why Do You Need Them?
A Key Performance Indicator (KPI) card is a common dashboard element that displays a single, important metric in a clear, digestible format. Instead of making users search through a detailed chart or table, a KPI card pulls the most important number out - like Total Sales, New Users, or Conversion Rate - and puts it front and center. Think of it as the headline figure of your data story.
Here’s why they’re so effective:
- They demand attention: Big numbers are hard to ignore. KPI cards immediately draw the user's focus to the metrics that matter most.
- They provide quick status updates: Users can understand the health of the business in seconds. Is revenue up? Is user engagement down? KPI cards answer these questions immediately.
- They make data accessible: Not everyone is comfortable interpreting complex charts. A simple number is universally understood and makes your dashboard approachable for a wider audience.
Getting Started: Prepare Your Data
Before you can craft the perfect KPI card, you need a solid foundation: your data. Ensure you have connected Tableau to your data source, whether it's an Excel file, a Google Sheet, or a database like SQL Server. For this walk-through, we will use Tableau's sample "Superstore" dataset, which comes pre-loaded with the software.
A clean dataset should have your numbers categorized as Measures (the metrics you want to track, like Sales, Profit, and Quantity) and your labels as Dimensions (the categories you use to slice the data, like Order Date, Region, and Category). Tableau is usually pretty good at sorting this out automatically upon connection.
Method 1: Building a Simple, Single-Metric KPI Card
Let's start with the most fundamental KPI card - displaying one single, important number. We'll create a card to show Total Sales.
Step 1: Create a New Worksheet
Open a new worksheet in your Tableau workbook. It's a good practice to name your worksheets clearly. Double-click the tab at the bottom and rename it "Sales KPI". This helps you stay organized, especially when you start combining multiple cards into a single dashboard.
Step 2: Add Your Metric to the View
From the Data pane on the left, find your primary measure - in this case, the Sales metric. Click on Sales and drag it over to the Text box on the Marks card. Just like that, you’ll see the sum of all sales appear in your worksheet view.
Step 3: Format the Number for Clarity
The raw number might look a little messy (e.g., "$2,297,200.86"). Let's clean it up to be more readable.
- Right-click the
SUM(Sales)pill that’s now on the Text mark. - Select Format from the dropdown menu.
- A Format pane will appear on the left. Under the "Numbers" dropdown, select Currency (Custom).
- Here you can reduce the decimal places to 0, change the Units to thousands (K) or millions (M) for a cleaner look, and adjust the prefix. For our example, formatting it to "$2.3M" is much cleaner.
Step 4: Edit the Text Label to Add Context
A number on its own lacks context. We need to add a label so everyone knows what it represents.
- Click on the Text box in the Marks card. An editor window will pop up.
- Inside the editor box, you’ll see
<SUM(Sales)>. This is Tableau’s placeholder for the number you just formatted. - Type a title directly above the placeholder, such as "Total Sales".
- Now, make it look good. Highlight your "Total Sales" text and use the editor's options to make it bold, a bit smaller than the number, and perhaps a lighter shade of gray. Make the
<SUM(Sales)>placeholder text larger and darker. This visual hierarchy guides the eye to the metric first, then the title.
Your edit box might look something like this:
Total Sales
<SUM(Sales)>
Step 5: Adjust the View and Clean Up
To make the KPI card fill the available space, go to the toolbar and change the dropdown from Standard to Entire View. Finally, right-click on the worksheet title ("Sales KPI" at the top of the canvas) and select Hide Title. Since we added a label inside the text editor, the worksheet title is now redundant.
You now have a clean, polished, single-metric KPI card ready for a dashboard.
Method 2: Adding a Comparison Metric (e.g., Year-over-Year Growth)
A great KPI card doesn't just tell you what the number is, it tells you if that number is good or bad. Adding a comparison, like percent change from the previous period, adds a crucial layer of context. Let's build a card that shows current year sales and the year-over-year (YoY) percentage change.
Step 1: Create Your Core Calculated Fields
To compare two time periods, we need to isolate the metrics for each period using calculated fields.
Current Year Sales
First, we need a calculation that only returns sales from the most recent year in the dataset.
- Go to the dropdown menu at the top of the Data pane and select Create Calculated Field.
- Name it "Current Year Sales".
- Enter the following formula. This calculation uses a Level of Detail (LOD) expression
{MAX(YEAR([Order Date]))}to find the latest year in the entire dataset.
IF YEAR([Order Date]) = {MAX(YEAR([Order Date]))} THEN [Sales] END
- Click OK.
Previous Year Sales
Now, do the same thing for the prior year.
- Create another calculated field and name it "Previous Year Sales".
- Enter this formula:
IF YEAR([Order Date]) = {MAX(YEAR([Order Date]))} - 1 THEN [Sales] END
- Click OK.
Step 2: Create the YoY % Change Calculation
Finally, let's create the calculation for the percentage change.
- Create a third calculated field and name it "YoY Sales % Change".
- Enter the standard formula for percentage change:
(SUM([Current Year Sales]) - SUM([Previous Year Sales])) / SUM([Previous Year Sales])
- Click OK. Right-click this new calculated field in the data pane, select Default Properties > Number Format..., and set it to Percentage to ensure it always displays correctly.
Step 3: Build the KPI Card View
On a new worksheet, let's combine these fields into a single card.
- Drag Current Year Sales to the Text mark.
- Drag YoY Sales % Change to the Text mark as well.
- Click on the Text mark to open the editor and arrange your fields, just like we did in the simple card method. You can lay it out to show the primary metric first, followed by the comparison.
For example:
Sales (Current Year)
<SUM(Current Year Sales)>
Change
<SUM(YoY Sales % Change)> vs. Previous Year
Step 4: Add Conditional Colors and Arrows
Let's make our growth metric even more intuitive with a visual cue: color. We want positive growth to be green and negative growth to be red.
- Drag the YoY Sales % Change pill from the Data pane onto the Color box in the Marks Card.
- Click the Color box, then Edit Colors...
- In the popup window, choose the "Red-Green Diverging" palette.
- Check the Stepped Color box and set it to 2 steps. This creates two distinct colors (one for positive, one for negative) instead of a gradient.
- Check Use Full Color Range and click the Advanced button. Set the Center value to 0. This ensures any number above zero is green and any below is red.
To add an up or down arrow, create a final simple calculated field:
- Create a field named "YoY Growth Shape".
- Enter the formula:
IF [YoY Sales % Change] > 0 THEN "▲" ELSE "▼" END
- Drag this "YoY Growth Shape" onto the Text mark.
- Open the Text editor again, and place the
<SUM(YoY Growth Shape)>placeholder before your percentage change metric. Color this shape placeholder with the same logic: green for "▲" and red for "▼".
Putting It All Together on a Dashboard
Once you have your individual KPI card worksheets, you can assemble them into a cohesive dashboard.
- Create a new Dashboard.
- From the Objects menu, drag a Horizontal container onto the top of your canvas. This helps organize and align your objects neatly.
- Drag your KPI card worksheets (like "Sales KPI") from the Sheets list on the left and drop them inside the container.
- Right-click on each card's used space and select Fit > Entire View if needed.
- Continue adding more KPI cards ("Profit KPI", "Customers KPI", etc.) into the container, and Tableau will automatically space and align them.
Final Thoughts
Building KPI cards in Tableau transforms a data-heavy dashboard into an intuitive and powerful decision-making tool. By starting with a simple number and layering on contextual comparisons, colors, and indicators, you can convey critical business performance insights in just a few seconds.
While mastering these techniques in Tableau is a valuable skill, sometimes you need insights faster, without the multi-step configuration. We created Graphed to simplify this exact process. Instead of manually creating calculated fields and arranging elements for each KPI card, you can start a conversation by asking something like, "Show me my total sales and year-over-year growth," and Graphed instantly builds a real-time dashboard for you. It’s designed to give your whole team access to answers without the steep learning curve.
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.