Card visual in Power BI: many numbers, one visual

How the card visual in Power BI shows one or many measures with reference labels, categories, images and conditional formatting, why several values in one card load faster than several cards, the DAX for reference labels, and the legacy cards.

Short answer: the card visual shows a number big and clear. Drop several measures into Values and it draws a card for each, in one visual. Each card has up to three parts: the callout (the number), an image, and reference labels (smaller numbers that give context, such as "vs last year +8%"). A field in Categories repeats the cards per value (one row of cards per country). One card visual with five values loads faster than five separate cards, because it sends fewer queries to the model.

The top row of most reports is a line of numbers: revenue, orders, customers, margin. Built as separate visuals they line up badly, load one by one and each needs its own format. One card visual with all of them avoids all three.

What does a row of cards look like?

Revenue
  • 1.24 M
  • vs last year +8.1%
  • vs target 97%
Orders
  • 18,420
  • vs last year +3.4%
  • average 67.3
Customers
  • 6,110
  • new 1,280
  • returning 79%
Margin
  • 31.2%
  • vs last year -1.4 pts
  • target 33%
One card visual with four values, each with reference labels

How do you build one?

  1. In Visualizations, Build visual, pick Card. Since the new card became generally available, the visual called Card is the new one; reports built with the legacy card keep it.
  2. Add measures to Values. Each one becomes a card in the same visual.
  3. Add measures to Reference labels for the small context lines under each callout.
  4. Optional: a field in Categories, for example Customer[Country], repeats the cards for each country; selecting a category header filters the other visuals on the page (Ctrl to pick several).

How do you lay it out?

In Format visual:

  • Cards, Layout: the order of callout, image and reference labels inside each card, with a collage layout that gives one section more room.
  • Callout: size, alignment, display units (show the full number or K, M, B) and decimals.
  • Multi-card layout: how the cards share the visual, with Fixed size (exact pixel size, scroll bars when they do not fit) or Fit to space (cards grow and shrink). The two exclude each other.
  • Image and Callout image: a large image or a small one in the callout, from a file, a URL (also files in OneLake) or a data column, with a separate Hover state.
  • Apply settings to: format all cards at once, or one card from the Cards drop-down.

What DAX feeds the reference labels?

Reference labels are measures too. The four cards above use measures like these:

Revenue = SUM ( Sales[Amount] )

Revenue LY =
CALCULATE ( [Revenue], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )

Revenue vs LY % =
DIVIDE ( [Revenue] - [Revenue LY], [Revenue LY] )

Revenue vs Target % =
DIVIDE ( [Revenue], [Revenue Target] )

Margin vs LY pts =
( [Margin %] - CALCULATE ( [Margin %], SAMEPERIODLASTYEAR ( 'Date'[Date] ) ) ) * 100

A label that is text and number at once needs a format string, not a text measure, so it can still be formatted and coloured. Give Revenue vs LY % the custom format +0.0%;-0.0%;0.0% and it shows "+8.1%" or "-2.3%". A text measure built with FORMAT also works, but turns the number into text: it can no longer drive a colour rule.

How do you colour a card by its value?

Use conditional formatting (the fx button) on the callout or reference label colour. A rule on Revenue vs LY %: red below 0, green from 0. Or a measure that returns a colour:

Trend Colour =
IF ( [Revenue vs LY %] >= 0, "#1A9E75", "#D64550" )

Then Field value with Trend Colour. The same rule applied to all cards works only where the measure fits each card; set colours per card with Apply settings to.

What goes wrong?

  • Five separate cards. Slower to load and hard to align; put the values in one card visual.
  • A number with no context. A callout alone answers "how much?" but not "is that good?". Add a reference label with the comparison, or use the KPI visual.
  • Text measures for numbers. FORMAT returns text: no display units, no conditional colours, slower in big models. Use format strings.
  • Display units that hide differences. 1.2 M and 1.2 M can be 1,150,000 and 1,249,000. Show a decimal more, or the full number, when the difference matters.
  • Categories with many values. Fifty countries make fifty card rows; filter to the top ones.

Where can you check this?

Where do you start?

Put the page's headline measures into one card visual, add one reference label each with the comparison that matters, and colour that label by direction. Actual, target and variance in DAX builds the comparison measures, and FORMAT and format strings shows the "+8.1%" formats.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.