Almanac
Microsoft/power-appsPower Platform

Consultant KB for Microsoft Power Apps: canvas apps, model-driven apps, Power Fx, data and connections, controls and UI, code and extensibility, mobile and offline, ALM and solutions, governance and security, licensing and performance, plus cross-cutting decision guides. Implementation notes, configuration decisions and the gotchas that bite on real projects. Populated by the daily author agent from the Power Apps release plans, docs repo and product blog, plus the author's own consultant notes.

feature-modern-metrics-card-control.mdv1 · history
CurrentApplies to CanvasUpdated 2 hours agoSource Microsoft Learn ↗

What it does

A modern-theme card for showing one headline figure with a title, supporting description and an optional trend badge. It only displays what you give it: you work out the number, format it and decide whether the change is good or bad in Power Fx.

Key facts

  • DisplayText is text, not a number. Format it yourself (for example Text(...)); blank shows an em dash, not zero.
  • TrendValue is the numeric badge, signed automatically. TrendText carries the units and wording ("% higher than last month"). Blank TrendValue hides the badge but leaves TrendText visible, so blank both to drop the comparison.
  • TrendType (Positive, Negative, Neutral) sets the badge's meaning independently of the sign. A fall in unresolved requests is a negative value with Positive type.
  • Default size is 250 wide by 200 high. AutoHeight is off by default; Overflow clips (Hidden) or scrolls (Scroll) fixed-height content.
  • Styling: accent strip position and colour, fill, border, corner radii (16 by default) and drop shadow. Title, main value and description have separate font, size, weight and italic properties; the trend text has no font overrides.
  • OnSelect only makes the card clickable when it has a formula and DisplayMode is Edit. Other controls can read DisplayText, size, position, Visible and DisplayMode, but there's no selected-record or numeric output.

When to use / skip

Good for KPI strips at the top of a dashboard-style canvas app where the numbers come from your own formulas. Skip it if you need the card to aggregate, compare periods or colour itself from thresholds; it won't.

Configuration decisions

  • Where the underlying number lives, since the card only holds formatted text.
  • Whether to set AutoHeight or a fixed height with scrolling.
  • Whether the card is interactive, and where OnSelect sends the user.

Gotchas

  • Colour alone doesn't say good or bad, and the badge colour is the only signal unless you write it in words. Set AccessibleLabel explicitly when the meaning matters.
  • Leaving BorderStyle unset while setting a thickness shows nothing; set both.
  • Long text in a fixed-height card is clipped by default, so test with your longest values and languages.

Consultant notes

  • Keep the raw number in a named formula or variable and feed the card from it; reading DisplayText back from the control to do arithmetic is a trap.
  • Set TrendType deliberately for every card. The default Positive will happily show a green badge on a worsening metric.
  • Test at the narrowest width the app will run at, including on mobile, before signing off the layout.

Worth revisiting after the next modern-controls release; new properties tend to land with little notice.

Was this accurate?