Power BI How-To
How to make a KPI card in Power BI
Build a KPI card in Power BI: field wells, a worked example, when the native visual is enough, and how to generate the .pbiviz without code.
By Nawaf Sharaf · Founder & Reliability Engineer · Updated
A KPI card is the first thing a reader looks at: one big number, a small delta against a target or prior period, and often a sparkline for the trend. Executive pages are rows of them, so a card's typography, padding and delta logic set the tone of the whole report.
Power BI's new Card visual (generally available since November 2025) covers a lot of this ground. This guide is for the cases it still doesn't: a sparkline inside the card, a delta badge whose colour rule you define, brand typography the theme can't express, and a layout that stays identical across twelve cards. It starts with the three-measure data shape.
Step-by-step
- 1
Shape the data for the KPI card
At minimum: a current-value measure. Recommended: a comparison measure (target or prior period) and a trend column (date, value pairs). In the finished visual those columns land in the Value, Comparison, Trend date, Trend value wells, so name them that way from the start.
- 2
Load a small sample into Power BI Desktop
Import at least six months of MRR against a date table, as in the example. The sparkline needs the months to have a shape, and the comparison needs the month before the latest one to exist.
- 3
Describe the KPI card and generate the .pbiviz
On VizForge, describe the chart in plain English and say what matters for this one: delta format: absolute, percent, or both; and the colour rule (green when higher, or inverted for cost metrics); sparkline, mini bars, or no trend; typeface and sizes for the value, the label and the delta. The pipeline writes the TypeScript, type-checks it and packages a .pbiviz.
- 4
Import the .pbiviz into Power BI Desktop
In the Visualizations pane, open the three-dot menu, choose Import a visual from a file and select the .pbiviz. The visual appears in the gallery; add it to the page like any built-in chart.
- 5
Bind the field wells
Value: Numeric measure: the big number (MRR, Tickets, Uptime). Comparison: Optional numeric measure: target or prior period. Trend date: Optional date column: the sparkline's X axis. Trend value: Optional numeric measure: the sparkline's Y values.
- 6
Check the first render, then format
A delta of +100%: the Comparison measure returns BLANK for the current period; check the date table relationship. Sparkline flat or empty: the Trend date is a text column, or the page is filtered to one month. Then open the formatting pane and set value font size and number format (compact 204k vs. 204,000).
Field wells the generated KPI card exposes
After import, these are the data roles you drop fields into. The names come from the visual’s capabilities.json, which you can rename before packaging if your team uses different terms.
| Well | Takes | Note |
|---|---|---|
| Value | Numeric measure: the big number (MRR, Tickets, Uptime). | Format the measure itself so the card inherits it. |
| Comparison | Optional numeric measure: target or prior period. | The delta is Value minus Comparison, or a ratio, as you specify. |
| Trend date | Optional date column: the sparkline's X axis. | Needs a proper date table so months sort correctly. |
| Trend value | Optional numeric measure: the sparkline's Y values. | Usually the same measure as Value, evaluated per date. |
Worked example
Monthly recurring revenue card with last-month comparison and a 6-month trend.
| Month | MRR |
|---|---|
| May | 182k |
| Jun | 188k |
| Jul | 191k |
| Aug | 187k |
| Sep | 196k |
| Oct | 204k |
What the chart draws: 204k in large type, '+4.1% vs Sep' in a green badge underneath, and a six-point sparkline that dips in August. Value is the October MRR, Comparison is the September MRR via DATEADD, Trend is the same measure by month.
Live preview
The AI alternative: Describe your KPI card in plain English and VizForge generates the .pbiviz, source included. 5 free credits on signup, no card required.
Generate a KPI card on VizForge →Without code: what to put in the prompt
The generator turns a description into the TypeScript, so the description is where the decisions live. For a KPI card, say:
- Delta format: absolute, percent, or both; and the colour rule (green when higher, or inverted for cost metrics).
- Sparkline, mini bars, or no trend.
- Typeface and sizes for the value, the label and the delta.
- Card padding and corner radius, so a row of cards aligns with your page grid.
- What to show when the comparison is missing (hide the badge, or show a dash).
Example VizForge prompt
KPI card: big number (current MRR), small delta below showing vs. last month with green up-arrow or red down-arrow, sparkline of the last 12 months, padding 16px, our brand font.
Customise it: formatting options worth exposing
Anything you name as adjustable becomes a card in Power BI’s formatting pane, which a report theme can then set for every copy of the visual. For a KPI card the options that earn their place are:
- Value font size and number format (compact 204k vs. 204,000).
- Delta badge colours for up, down and neutral, plus an 'invert good direction' toggle.
- Sparkline colour, line width and whether the area under it is shaded.
- Label text and position (above or below the value).
- Background, border and padding, so the card can be transparent on a designed page.
For changes the pane doesn’t cover, edit settings.ts and visual.ts in the source that ships with the download and repackage; or refine on VizForge and get a v2 that keeps everything you didn’t mention.
When native Power BI is enough (as of November 2026)
Power BI's new Card visual (GA since November 2025) handles a big number with a label, reference labels for comparisons, images and conditional formatting, and it can show several values in one visual. The KPI visual adds a trend axis and a goal. Use them when that covers your card; they're certified, themeable and get Microsoft's updates. A custom card is for a sparkline next to the number, a delta rule you control, and pixel-exact alignment with a designed page background.
Limits of Marketplace KPI card visuals
Marketplace cards typically fix the layout (value here, label there) and the delta logic (higher is always good), and sparklines are commonly a paid-tier feature. Fonts are limited to the vendor's list, so brand typography means settling for the closest match. You also cannot add a fourth measure to show, say, a second comparison.
The general trade-offs (per-user licensing, closed source, no new field wells) are the same for every chart type; see VizForge vs Microsoft Marketplace visuals for the full comparison.
Download, install and first render
The download is a standard .pbiviz plus the TypeScript source. Import it in Power BI Desktop (Visualizations pane → three dots → Import a visual from a file), add it to the page and bind the wells above. Then check the KPI card against this list before you connect the full dataset:
- A delta of +100%: the Comparison measure returns BLANK for the current period; check the date table relationship.
- Sparkline flat or empty: the Trend date is a text column, or the page is filtered to one month.
- Number showing as 204000.00: set the format on the measure, not in the visual.
- Cards in a row with different heights: the label wraps on one; fix the width or shorten the label.
When to use a KPI card
- Executive dashboard KPI row (revenue, customers, NPS, churn)
- SaaS metrics card (MRR, ARR, logo growth)
- Operations scorecard (uptime, incidents, response time)
- Real-time monitoring (last-hour events, active users)
- Portfolio value snapshots with prior-day change
Frequently asked questions
Will the visual work in Power BI Service, Premium and embedded reports?
Yes. A .pbiviz is a standard Power BI custom visual and renders the same in Desktop, the Service, Premium and Premium per User capacities, and embedded scenarios. Tenant admins can restrict custom visuals to certified or organisational ones; if yours does, publish the .pbiviz as an organisational visual rather than importing it per report.
What if I need to change the visual later?
Two paths. Refine on VizForge with an instruction such as "add a target line" and get a v2 .pbiviz that keeps everything you didn't mention; or open the TypeScript source that ships with every download in VS Code, edit it and repackage with pbiviz package.
Can the card use my brand colors?
Yes. Prompt with your hex values or let the visual pick up the current Power BI theme. Arrow and badge colors are configurable separately.
Sparkline vs. mini bar chart?
Either. Specify your preference in the prompt; the formatting pane lets you switch after generation.
How does it handle zero or missing data?
VizForge's AI validation catches null/empty DataView first thing in update(), so the card renders a dash instead of crashing.
Can I tap the card to drill through?
Yes — all VizForge visuals support standard Power BI drill-through. Set your target page and the card acts as a drill source.
Put your KPI card on a designed page
Free Design Studio page layouts. Download the background, theme and PBIP project, then import the visual into the slot.
Operations template
Customer SupportHas a slot for it: “First response time”.
Operations template
Call Centre OperationsHas a slot for it: “Calls waiting”.
IT template
IT Service DeskHas a slot for it: “Open incidents”.
Design the page around it, free
A custom visual looks best on a designed page. The free VizForge Design Studio lays out a branded report page at Power BI’s pixel size and exports the background image, a theme JSON and a PBIP project. No signup.
Open the free Design Studio →Guides for related charts
Reference
Data shape, DAX measures, related visuals.
Index
One guide per Power BI visual type, plus the Design Studio guides.
VizForge — AI-generated Power BI custom visuals.