Excel Dashboard Masterclass Step by step · Lab 6

Build 4 Excel KPI Cards With GETPIVOTDATA

Build four KPI cards that read a PivotTable with GETPIVOTDATA, add this-year-vs-last-year, and colour them with tested conditional formatting.

· 5 min read

Revenue KPI card with an up arrow and 13.8% vs last year line in green
Watch the lesson: Lab 6: KPI Cards With GETPIVOTDATA and Conditional Formatting | Excel Dashboard Masterclass

A dashboard opens with a few big numbers. But a number alone says little: two point one million is good news only if last year was lower. In Lab 6 we build four KPI cards, each with a label, a value and a line of context, coloured by rules.

Step 1: A card that reads the PivotTable

A card is a few formatted cells. Merge D5:F5 for the label (Total revenue), and D6:F7 for the value. The formula does not add up the table; it reads the PivotTable:

=GETPIVOTDATA("Sum of Revenue", Pivots!$E$3)

Formula bar with GETPIVOTDATA Sum of Revenue and the revenue card showing $2,100,904
Why read the PivotTable? Because slicers will filter it, and the card will follow.

Format it as a headline: currency, no decimals, 20 points, bold, a thin border.

Step 2: Four equal cards

Profit uses the same formula with Sum of Profit. The margin card needs no PivotTable: profit divided by revenue, inside IFERROR so an empty filter shows nothing instead of an error. Orders uses Count of Order ID with a comma style.

Four KPI cards: revenue, profit, margin 35.9% and orders 3,967
Four cards, same size, same three rows, built with the same steps.

Step 3: This year against last year

The comparison is a calculation, so it belongs on the Analysis sheet: revenue this year and last year with GETPIVOTDATA filtered by Year, then growth = this year ÷ last year − 1. Revenue grew 13.8%.

Analysis sheet block: revenue this year, last year, revenue growth 13.76%, profit growth 13.43%
The growth calculations live off the dashboard.

Back on the card, row 8 builds a sentence: an arrow (up when growth is zero or more, down when negative), the percentage, and vs last year.

Revenue card with the line up 13.8% vs last year
The line of context judges the number for the reader.

Step 4: Green and red, by rule

Conditional Formatting → Highlight Cell Rules → Text that Contains the up arrow: green. A second rule for the down arrow: red. And a rule on the margin: less than 30%, red.

How you know it worked

Never trust a rule you have not seen fire. On Analysis, type −5% over the revenue growth for a moment: on the dashboard the arrow turns down and the line turns red. Then put the formula back.

Analysis sheet with revenue growth temporarily set to -5% for testing
Testing the rule with a temporary value.

The arrow matters as much as the colour: about one man in twelve does not see the difference between red and green, and the card must still read correctly for them.

Do it yourself

Lab guides, practice and full mock exams come with a subscription. See the plans