What do you compare a KPI against? The target, last week and the trend
Turn a number on its own into one that tells you whether you're on track: against the target, against last week and against its own history.
Free course. Your Maestro, an AI, .
On Monday, Lucía's dashboard says: Clinic no-show rate: 11.5%. Is that good or bad? Should she act on it or not?
There's no way to tell. A number on its own doesn't say whether you're on track. What turns it into a signal is a comparison: against what you expected, against last week, against the others. Pick the one that helps Lucía:
Check yourself: Which of these lines helps Lucía most on Monday morning?
Three comparisons that almost always help
- Against the target. Clínica Alba's leadership set a target of 10% or less. With the target on screen, Lucía doesn't have to remember it, and 17.1% reads as "7 points over" with no mental math. If there's no target, ask who should set one: a dashboard without a target invites the same argument every Monday about whether the number is high.
- Against the previous period. Is it getting better or worse? Last week Cholula was at 16.5%. The natural comparison is the period you make decisions on: if Lucía decides weekly, compare against last week.
- Against its own history. A single week can be noise. In July, Cholula was near 9%; since late August it hasn't dropped below 12%. You can't see that in one number: you see it in a line.
In seasonal businesses, like a store in December or a school during summer break, add a fourth: the same period last year. The clinic's data covers one quarter, so we don't use it here.
Step through the chart to see each site's history:
Step 1 of 3
Three sites, thirteen weeks
Each point is one site's no-show rate for one week, calculated with Lucía's definition sheet. Before you look for the problem site, read the axes: the vertical one is the no-show rate and starts at 0%, so the gaps between the lines are real.
Percentage points, not percent
When a percentage changes, there are two ways to describe it, and people mix them up all the time. Cholula went from 16.5% to 17.1%:
- It rose 0.6 percentage points. That's the subtraction: 17.1 minus 16.5.
- It rose about 4%. That's the relative change: 0.6 points on top of 16.5.
Both are true, but "it rose 0.6%" is neither one. On a dashboard, write a rate's change in points and put the previous value next to it: "+0.6 pts (was 16.5%)." Nobody has to guess.
What about red, yellow and green?
Coloring a number red or green helps people see where to look, but it doesn't replace the comparison: red doesn't say whether you're one point or seven over the target, or whether you've been improving. Also, not everyone can tell red from green. If you use color, let it go with the number and the target, never instead of them. If your workplace runs on red-yellow-green status colors, ask your Maestro how to add context.
Check yourself: Cholula's no-show rate went from 16.5% to 17.1%. How do you write that on the dashboard?
Try it
This chart already compares each site against the previous week: the bar is this week and the thin mark is last week. What's missing is the target. Add a dashed line at 10% so Lucía can see at a glance which sites are over.
To do that, add one more layer to the layer list. A vertical rule at 10% looks like this:
{"mark": {"type": "rule", "strokeDash": [4, 4]}, "encoding": {"x": {"datum": 0.1}}}You're done when you see the dashed line crossing all three bars and Cholula's bar runs past it. If the editor flags a JSON error, paste it to your Maestro.
Add the 10% target as a third layer: a dashed vertical rule at x = 0.1. You're done when the line crosses all three bars and you can see that Cholula is the only site clearly over the target.
Your turn
Add the 10% target as a third layer: a dashed vertical rule at x = 0.1. You're done when the line crosses all three bars and you can see that Cholula is the only site clearly over the target.
Edit the JSON; the preview updates when you pause.
How this maps to Altair
Altair builds this same JSON: chart.to_json() prints it. "mark": "point" is alt.Chart(df).mark_point(). Each encoding channel is an argument to .encode(), such as x=alt.X("field:Q", scale=alt.Scale(type="log")) or color="field:N". Each transform entry is a call such as .transform_filter("datum.year == 2007").
With the target on the chart, Monday's decision almost makes itself: Cholula is over and still climbing, and the other two are on target. That's what a comparison is for: the number tells you what to do, and nobody has to remember what it was last week.