How to Build a Tableau KPI Card Without the Calculated-Field Headache
Skip the table calcs and floating containers. Here's how to build a reusable Tableau KPI card as a custom extension with Claude Code, in one prompt, and when the native route is still fine.
The fastest way to build a Tableau KPI card is to stop hand-building it. Native Tableau has no built-in KPI card, so the usual route is a stack of calculated fields, table calculations, and floating containers for every single tile. There's another way: build the card once as a custom extension with Claude Code, then reuse it on any dashboard. This guide shows you both, and why the extension route saves you the headache after the first build.
Is there a built-in KPI card in Tableau?
No. Tableau has no native KPI card visual. To get the familiar layout (a big number, a period-over-period comparison, a trend sparkline) you build it yourself from worksheets, calculated fields, and layout containers. That's why every "how to make a KPI card" tutorial runs several steps long, and why so many of them open by admitting the process is fiddly.
Why the native KPI card is such a pain to build
The native approach works, but it asks a lot for what looks like a simple tile. A typical build needs:
- A current-period and prior-period calculated field (often with FIXED level-of-detail expressions).
- A percent-change calculation, plus a second calc just to swap the up/down arrow and color.
- Table calculations set to compute in the right direction so the numbers land correctly.
- A floating master container, then nested containers, to arrange each card and its sparkline.
- Manual formatting per card: font sizes, hidden titles, row dividers removed, colors matched.
Now multiply that by four cards on one dashboard, and repeat it the next time you need KPIs on a different workbook. The logic isn't hard so much as repetitive and easy to get subtly wrong, exactly the kind of work worth doing once and reusing.
The faster way: build it once as an extension
A Tableau dashboard extension is a small web app that sits on your dashboard and reads your worksheet data through the Extensions API. Build a KPI card as an extension and you get a single, reusable component: drop it on any dashboard, point it at a worksheet, and it renders the big number, the comparison, and the sparkline for you. No per-card calculated fields. No container gymnastics.
The catch used to be that building an extension meant knowing the manifest format, the Extensions API, and static hosting. That's the part Claude Code can now handle, if it knows the rules going in.
How to build a Tableau KPI card extension with Claude Code
Here's the short version of the workflow. You need Tableau Desktop (the free trial works; extensions don't run in Tableau Public) and Claude Code.
- Describe the card. Tell Claude Code what you want: a KPI card that reads the first worksheet's summary data, shows the first measure as a big number, adds a prior-period percent with a green/red arrow, and a sparkline.
- Let it scaffold. It writes the card as plain HTML, CSS, and JavaScript (vanilla, so it can be hosted as static files), plus the complete
.trexmanifest Tableau needs to load it. - Host it. Push the files to GitHub Pages, a free static host over HTTPS, and point the manifest at that URL instead of localhost.
- Load it in Tableau. Drop an Extension object on your dashboard, point it at your manifest, and the card renders against your worksheet.
- Iterate. Ask for the empty-state handling, a config button, tooltips, whatever you want next. Because the standards are baked in, you're refining, not debugging.
The difference the right setup makes is hard to overstate. Without a skill guiding it, Claude Code guesses, and you spend the next forty minutes pasting errors back and forth. With one, it knows the rules before you ask.
Build it yourself
The TableauOps Extension Kit is a drop-in Claude Code skill, starter, and examples, so it builds any Tableau extension with the manifest, hosting, and error fixes already baked in, including a runnable KPI card example. It's $39, and it pays for itself the second time you skip the forty-minute fight.
Proof it works for someone newer, not just for me
Michael McCusker built his first Tableau extension on his own, hurdles and all, then ran it through the kit. Here's what he built: a full three-card KPI dashboard.
The new skill was great. I went from zero to a working dashboard in one initial prompt (although it did ask some good clarifying questions, which was great). I liked some of the standards that were baked in without having to discover them throughout, like creating two manifest
.trexfiles for dev and prod.
Michael McCusker, Tableau Tech Lead
Native method vs. extension: which should you use?
| Native KPI card | KPI card extension | |
|---|---|---|
| First build | Several steps per card | One prompt, with the right setup |
| Reuse on a new dashboard | Rebuild the calcs and containers | Drop it in, point at a worksheet |
| Skills needed | Tableau calcs and layout | Claude Code (no hand-coding) |
| Best for | A one-off card, or no extension setup | A reusable card you'll use again |
If you need a single card once and never again, the native method is fine. If you build dashboards regularly and keep rebuilding the same KPI tiles, the extension pays for itself the second time you use it.
Build your own KPI card extension
Skip the calculated-field headache. The TableauOps Extension Kit gives Claude Code everything it needs to build the card on the first prompt. Prefer to watch first? Join a free live build and see one built in real time.
Eric Summers, Tableau Ambassador & founder of TableauOps
Frequently asked questions
Is there a built-in KPI card in Tableau?
No. Tableau has no native KPI card visual. You build the layout from worksheets, calculated fields, and containers, or you use a custom extension that renders the card for you.
How do you show period-over-period change on a KPI card?
Natively, you create current-period and prior-period calculations, then a percent-change calc and a second calc to set the arrow and color. In an extension, the comparison is computed in code from the worksheet's summary data, so you configure it once.
Do Tableau extensions work in Tableau Public?
No. Extensions run in Tableau Desktop (including the free trial) and Tableau Server or Cloud, but not in Tableau Public. Build and test in Tableau Desktop.
Where do you host a Tableau extension?
GitHub Pages is a free, static, HTTPS host that suits extensions well. The important rule: the .trex manifest you load must point at the hosted URL, never localhost, or it will only work on your machine.
Can Claude Code build a Tableau extension on its own?
It can, but it needs the domain's rules, the manifest format, the Extensions API, and static hosting, to do it reliably. With a skill that encodes those rules, it builds correctly on the first prompt instead of guessing.