input-numericAX - 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.

spinner

Key Features

  • Supports multiple aggregation functions

  • Customizable with icons and formatting

  • Displays data in cards or standalone

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.

Basic Properties

These control the data source, calculation, and display of the Metric component.

Property
Type
Description
Example

Object Api Name

String

API name of the Salesforce object for metric data (e.g., Opportunity).

Opportunity

Filter

String

SOQL WHERE clause to filter records (e.g., StageName = 'Closed Won').

Status = 'Open'

Field Field Name

String

Numeric field to aggregate (e.g., Amount).

ExpectedRevenue

Aggregate Function

String

Aggregation type (options: SUM, AVG, COUNT, COUNT_DISTINCT, MAX, MIN).

SUM

Icon Name

String

SLDS icon to display with the metric (e.g., utility:metrics).

standard:opportunity

Label

String

Text above or beside the metric value (e.g., “Total Value”).

“Average Deal Size”

Description

String

Subtitle for additional context (e.g., “Last 30 days”).

“Based on Closed Deals”

Prefix

String

Text before the value (e.g., $).

No. of

Suffix

String

Text after the value (e.g., hrs).

%

Tooltip

String

Hover text for more details (e.g., “Total of open opportunities”).

“Click for details”

Display as Card

Boolean

Shows the metric in a card layout if true.

true


Examples

Example 1: Total Opportunities on Opportunity Page

Scenario: Display a key performance indicator showing the total value of all active opportunities, providing sales teams with immediate visibility into pipeline value.

Steps

1

Edit your Opportunity record page

2

Drag the AX - Metric component onto your page layout

3

Configure Data Source

  • Set Object Api Name to Opportunity

  • Set Filter to StageName != 'Closed Lost' (excludes lost opportunities from the calculation)

4

Configure Metric Calculation

  • Set Field Field Name to Amount (the currency field to aggregate)

  • Set Aggregate Function to SUM (adds up all opportunity amounts)

5

Configure Display Formatting

  • Set Label to "Total Opportunity Value" (descriptive title for the metric)

  • Set Suffix to "$" (adds currency symbol after the value)

6

Set Visual Presentation

Check Display as Card for professional container styling

7

Save and test the metric calculation

Result: A prominently displayed card showing the total value of all active opportunities, giving sales teams instant visibility into their pipeline performance


Key Considerations

  • Data Source: Use Filter to limit records; ensure Field Field Name is numeric.

  • Formatting: Add Prefix or Suffix for clarity (e.g., currency symbols).

  • Performance: Set a low Maximum Number of Records for large datasets.

  • 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 Field Name and Filter syntax; verify field permissions.

  • Wrong Calculation: Ensure Aggregate Function matches the field type (e.g., Number for SUM).

  • Card Not Showing: Confirm Display as Card is true.

  • If Issues Persist: Contact our support team at [email protected]envelope for assistance.


Summary

The Avonni Metric component enhances Lightning pages with actionable KPI displays. It’s ideal for dashboards or record insights.

Last updated

Was this helpful?