AX - Metric
Overview
AX - Metric is a Lightning App Builder component that displays calculated values from your Salesforce records—such as totals, averages, counts, and other aggregations—on record, app, and home pages.
Use it to show essential numbers at a glance, such as total revenue, average deal size, open case counts, or any custom calculation from your data. Configure the metric label, icon, formatting, and data source right in App Builder without formulas or code.
Perfect for executive dashboards, performance scorecards, at-a-glance summaries on record pages, or anywhere users need to see key numbers without running reports.
Getting Started
Use this simple tutorial to learn the basics of the Metric component and start building your use cases.
Key features
Aggregation Functions: Supports SUM, AVG, COUNT, COUNT_DISTINCT, MAX, and MIN.
Visual Formatting: Customize with icons, prefixes, suffixes, and tooltips.
Flexible Display: Show the metric as a standalone value or inside a styled card.
Dynamic Bindings: Use
{{Record.FieldApiName}}in the Filter or Description to keep the metric context-aware.
Use Cases
Opportunity Page: Show average deal size or total quote value with an owner avatar.
Account Page: Display open case count or maximum past purchase value.
Campaign Page: Present total leads or highest engagement rate with bold indicators.
Sales Dashboard: Summarize pipeline value or deals per rep with team avatars.
Service Management Overview: Show max resolution time or average CSAT score.
Marketing Overview: Display campaign ROI or lead count with visual cues.
Configuration
Add the Metric component to a Lightning page in App Builder and configure it via the Properties Panel.
Properties
Object Api Name
String
—
Yes
API name of the Salesforce object used to retrieve records for metric calculation. Examples: Opportunity, Case, Campaign.
Filter
String
—
SOQL WHERE clause used to filter which records are included in the metric calculation. Example: StageName = 'Closed Won' or Status = 'Open'.
Field Api Name
String
—
Yes
Field API name containing the numeric value to be aggregated and displayed. Examples: Amount, ExpectedRevenue, Score__c.
Aggregate Function
String
—
The type of aggregation applied to the field. Valid values: SUM, AVG, COUNT, COUNT_DISTINCT, MAX, MIN. Example: SUM for total pipeline value or AVG for average resolution time. Options: AVG, COUNT, COUNT_DISTINCT, MAX, MIN, SUM.
Label
String
—
Text displayed above or beside the metric value, describing what the metric represents. Example: “Average Deal Size” or “Open Case Count.”
Description
String
—
Additional text displayed with the metric to provide more context. Example: “Last 90 days” or “Based on closed deals.”
Icon Name
String
—
The Lightning Design System name of the icon (e.g.,…
Prefix
String
—
Text displayed before the metric value. Commonly used for currency symbols (e.g., $) or abbreviations (e.g., “No. of”).
Suffix
String
—
Text displayed after the metric value. Useful for units (e.g., “hrs”, “%”, “days”).
Tooltip
String
—
Text displayed on hover to provide additional context or explanation for the metric.
Display as Card
Boolean
true
If true, renders the metric inside a styled card container for visual prominence in dashboards or record pages.
Use Case Examples
Example 1: Rollup Open Opportunity Amount
Scenario: Display a key performance indicator showing the total value of all active opportunities for an account, providing sales teams with immediate visibility into pipeline value.
Steps
Result: A prominently displayed card showing the total value of all active opportunities, giving sales teams instant visibility into their pipeline performance
Example 2: Count Open Cases on the Account page
Scenario: Display a service KPI to drive customer satisfaction providing teams with a clear view of case activity for a client.
Steps
Key Considerations
Data Source: Use
Filterto limit records; ensureField Api Namematches a type supported by the chosenAggregate Function.Formatting: Add
PrefixorSuffixfor clarity (e.g., currency symbols).Performance: Keep
Filterselective — the aggregation runs across all matching records.Accessibility: Test contrast with icons; use tooltips for context.
Limitations: Respects sharing/FLS rules; no real-time updates.
Troubleshooting Common Issues
No Value Displayed: Check
Field Api NameandFiltersyntax; verify field permissions.Wrong Calculation: Ensure
Aggregate Functionmatches the field type (e.g., Number for SUM).Card Not Showing: Confirm
Display as Cardistrue.If Issues Persist: Contact our support team at [email protected] for assistance.
Last updated
Was this helpful?
