Codex KPI Card
KPIA sleek, branded KPI card with dynamic accent colours and change indicators.
Styles
4 stylings shipped — every one is a real render, in your theme.
Overview
Your metrics deserve better than the default card. Codex KPI Card replaces Power BI's built-in card visual with a purpose-built KPI tile that communicates status at a glance. Show a value, a subtitle, a change pill, and a colour-coded border — all driven by your data, not hardcoded formatting.
Ideal For
- Executive dashboards where every pixel counts
- Multi-metric pages with consistent card styling across 4–36 KPIs
- Operational monitoring where green/amber/red status must be immediately obvious
- Report templates that need to match corporate brand guidelines exactly
Key Features
- Dynamic accent colour driven by a measure — colour each card independently based on data status
- Change pill with directional arrow — configurable as upIsGood, downIsGood, or neutral
- Subtitle line for context (e.g. 'vs last week', 'YTD', 'estimated cost')
- Text colour driven by a measure — value text changes colour with the accent
- Hover tooltip showing measure name, value, and variance
- Click to cross-filter other visuals on the page
- Clean, minimal design — no chart junk, no unnecessary chrome
Use one CardConfig table with a CardID filter per visual instance. This lets all 4–36 cards share the same 6 measures, controlled entirely by your data.
Help guide
What goes in each field
| Field well | Put in | Required | What it does |
|---|---|---|---|
| Value | Measure | Yes | The headline number. A text measure works too (for example a store code). |
| Label | Measure | No | The title above the value. |
| Subtitle | Measure | No | A context line under the value, such as "Target: 90%". |
| Change Value | Measure | No | The movement shown in the change pill, as a fraction: -0.18 means down 18%. |
| Change Label | Measure | No | Your own text for the pill. Leave it empty and the pill writes the change for you, such as "18% vs prior". |
| Accent Colour | Measure | No | A hex colour such as #D13438 for the accent bar. Overrides the Card Style colour. |
| Text Colour | Measure | No | A hex colour for the value text. Overrides the Value Colour setting. |
| Category | Column | No | Bind a column to make the card cross-filter the page when clicked. |
The card shows one result. Put it in a context that returns one row: a page filter, a slicer, or no Category at all.
Build the measures
The examples assume a Sales table with an Amount column, related to a marked date table called 'Date', plus a [Revenue Target] measure. Swap in your own names.
Value: this month's revenue
Revenue MTD =
TOTALMTD ( SUM ( Sales[Amount] ), 'Date'[Date] )
Change Value: change against the same period last month
Revenue MTD vs Prior =
VAR Curr = [Revenue MTD]
VAR Prev = CALCULATE ( [Revenue MTD], DATEADD ( 'Date'[Date], -1, MONTH ) )
RETURN
DIVIDE ( Curr - Prev, Prev )
DIVIDE returns blank when there is no prior period, and the card hides the pill rather than showing a wrong number.
Give this measure a percentage format in the model (Measure tools → Format → Percentage). The pill uses that format to write "18% vs prior". Without it, the pill reads "0.2 vs prior".
Subtitle: show the target in words
Revenue Subtitle =
"Target: " & FORMAT ( [Revenue Target], "$#,0" )
Accent Colour: red when behind target, green when on it
Revenue Accent =
IF ( [Revenue MTD] >= [Revenue Target], "#107C10", "#D13438" )
The colour measures must return a hex code. Anything else is ignored and the card uses its own setting.
Put it together
- Add the visual and drag Revenue MTD into Value.
- Add a title measure such as
Revenue Label = "Revenue (MTD)"to Label, and Revenue Subtitle to Subtitle. - Drag Revenue MTD vs Prior into Change Value.
- In the Format pane, open Value Format and set Format to Currency with your Currency Symbol.
- Open Change Indicator and set Direction Logic. Use Down is Good for costs, error rates and wait times, so a fall shows green.
Tips
- Set Value Format → Format to Percent for a percentage measure. Power BI stores 45% as 0.45, and the card multiplies by 100 for you.
- An empty or blank Value shows the setup prompt instead of a card. Check the measure returns a result for the current filters.
Billed through Microsoft AppSource