Short answer: the KPI visual shows one number with two pieces of context: whether it is ahead of or behind a Target, and how it got there (a Trend axis drawn behind it). It needs a measure in Value, a date or period field in Trend axis, and optionally a measure in Target. The value shown is the last point of the trend, so sort the trend correctly before converting the visual. Set the direction (high is good or low is good) so that a falling cost is green.
A card that says "1,820" leaves the reader asking: is that good? Compared to what? Going up? The KPI visual answers all three in the space of a card.
What does a KPI visual look like?
The big number is May's 130. It is 8.3% above the goal of 120, so it is green, and the shape behind it says it got there by climbing since March.
When should you use it?
Microsoft puts it in two questions: "What am I ahead or behind on?" (progress) and "How far ahead or behind am I?" (distance to a goal). Use it in the top row of a page, one per headline metric: revenue against budget, orders against last year, tickets against an SLA.
How do you build one?
- Start with the measure as a column chart:
[Revenue]on the Y-axis and the month on the X-axis. - Sort it by the month, ascending (More options (...), Sort axis). Microsoft warns that once the visual is a KPI there is no option to sort, so sort first.
- Switch the visual to KPI. The wells become Value, Trend axis and Target.
- Drag the target measure to Target, for example
[Revenue Target]or last year's revenue. - In Format visual: Callout value (display units, decimals, font), Icons (a green check for good, a red exclamation mark for bad), Trend axis (on or off, and the direction: high is good or low is good), Target label with Distance to goal, and Date (shows the last period).
What DAX does it need?
A measure for the value and one for the target. The KPI takes the value of the last period on the trend axis that has data, so the trend must stop at today:
Revenue = SUM ( Sales[Amount] )
Revenue Target = SUM ( Budget[Amount] )
Revenue to Date =
IF ( MIN ( 'Date'[Date] ) <= TODAY (), [Revenue] )Without Revenue to Date, months later in the year with a budget but no sales can make the KPI show a blank or zero as "the last value". The target can also be last year:
Revenue LY =
CALCULATE ( [Revenue], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )For a cost or a delivery time, set the direction to low is good: 2.8 days against a target of 3 is then green.
How do you show a year-to-date KPI?
The KPI's callout is the last trend point, so with months on the trend axis it shows the last month alone. To show a running year-to-date value with a monthly trend, use a YTD measure in Value and Target:
Revenue YTD = TOTALYTD ( [Revenue], 'Date'[Date] )
Target YTD = TOTALYTD ( [Revenue Target], 'Date'[Date] )The trend then climbs through the year, and the callout is the year so far against the target so far.
What goes wrong?
- The wrong last value. Future months with a target but no actuals end the trend at blank or 0. Stop the value at today.
- Unsorted trend. Sorting is not available after the conversion; a trend sorted by value draws a meaningless line and takes the wrong "last" point.
- Red when it is good. For costs, churn, delays, set low is good.
- A total in the callout. People expect "this month" or "year to date"; say which in the title.
- Too many KPIs. Eight KPI tiles in a row make none of them stand out. Three to five headline numbers per page.
Where can you check this?
- Microsoft Learn: Create key performance indicator (KPI) visualizations
- Microsoft Learn: TOTALYTD function (DAX)
- Microsoft Learn: SAMEPERIODLASTYEAR function (DAX)
Where do you start?
Pick three to five headline measures, give each a target and a trend stopped at today, and set the direction for the ones where lower is better. Actual, target and variance in DAX builds the measures, and what makes a good KPI helps choose them.