> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://docs.mammoth.io/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# Metrics panel

> Create single-value metrics such as Sum, Average or custom formulas in the Mammoth Metrics panel, format them, and lock them while explore filters change.

The Metrics panel calculates single-value metrics from your columns, such as total revenue, average deal size, or defect rate. Metrics update as you filter your data in Explore Cards.

![Metrics panel open beside the data grid with two metric cards: Avg of Shipped Weight 7,040.35 and Max of Quantity Sold 3983](https://docs.mammoth.io/api/v1/images/20260421_090742_Metric_panel_with_metric_card1.jpg)

Use it for sales monitoring, quality control tracking, and financial compliance, where you need key numbers at a glance.

## Create metrics

You can create a metric from a column header or from the Metrics panel.

### Path 1: From the data grid column header

To create a metric for one column, start from the data grid.

1. Hover a numeric column header in the data grid
2. Click the **Create Metric** icon that appears in the column header (it appears on numeric columns only)
3. A "Create Metric" popup appears with:
   - **Metric name**: Auto-populated (e.g., "Sum of quantity_on_hand")—editable
   - **Function**: Dropdown to select your aggregation (Sum, Average, Standard Deviation, Min, or Max)
   - **Formatting**: Currency, percentage, decimal, and short form options
4. Click **Create Metric** to add it to the panel instantly. A "Metric added" message confirms it
5. Click **More options** instead to open the full metric editor (Title, Subtitle, Description, expression, conditions) with these settings filled in

![Create Metric popover opened from the quantity column header, with Metric name, Function, Formatting, Short Form, More options and Create Metric](https://docs.mammoth.io/api/v1/images/20261009_195053_CreateMetricPopover.jpg)

### Path 2: From the Metrics panel

There are two ways to open the Metrics panel:

- **Action bar:** Click the **Metrics** icon in the action bar at the top of the data editor, next to the Highlights icon. The icon shows an active state when the panel is open.
- **Right-edge tab:** Click the rotated "Metrics" tab on the right edge of the View interface. When the View has metrics, the tab shows how many.

Both open the same Metrics panel.

![View with the Metrics tab open, showing the Create a metric empty state and a New Metric button](https://docs.mammoth.io/api/v1/images/20260605_092228_metrics-toolbar-icon-active1.jpg)

When no metrics exist, the empty state displays:

- **"Create a metric"** heading
- **"Use this space to create some metrics from numerical data"** description
- **+ New Metric** button

Click **+ New Metric** to open the full New Metric modal.

Metrics are unavailable in Preview mode. The panel says so, and when the View has metrics it offers **Exit Preview**.

### New metric modal

The New Metric modal opens in **SQL** mode by default, with an AI-powered expression generator at the top. When enabled for your workspace, a switch lets you change between **SQL** and **Formula** modes. The book icon next to the title opens this documentation.

![New Metric modal with a prompt box and Generate button, SQL and Formula tabs, SQL Expression, Format with Display in short form, a Title field, Add More Details, and Cancel and Submit buttons](https://docs.mammoth.io/api/v1/images/20261009_194758_NewMetricModal.jpg)

AI Generate (default—SQL mode)

1. Type a plain-English description in the box labelled "Describe what you want to generate"—for example: *"Create a metric for the total quantity sold"*
2. Click **Generate** (or press Enter)—the AI writes the SQL expression for you
3. Review the generated expression in the **SQL Expression** editor and adjust if needed
4. Optionally add a condition to filter which rows the metric includes. If your description includes a filter, Mammoth can extract it into the condition

Formula mode

Click **Formula** (next to **SQL**) to build the expression manually using functions and column references. You can add a condition to filter which rows the metric includes in this mode too.

Right-side preview

The modal shows a live preview panel on the right with:

- A metric card rendering the current result
- A data grid showing the underlying dataset rows

Format section

| Option | Description |
| --- | --- |
| Numeric (default) | Plain number |
| Thousands separator (on by default) | Shows 1,234 instead of 1234 |
| % | Percentage |
| Currency | Choose a currency symbol—USD ($), EUR (€), GBP (£), JPY (¥), or INR (₹) |
| Decimal arrows (&lt; 0.00000 &gt;) | Set precision up to 5 decimal places (2 by default). Disabled while short form is on |
| Display in short form | Converts large numbers: 1,234,567 → 1.23M |

Label section

| Field | Description |
| --- | --- |
| Title | Primary label on the metric card (required) |
| Add More Details | Expands to reveal Subtitle and Description fields |

Click **Submit** to add the metric to the panel. **Submit** stays disabled, with a tooltip saying why, until the metric has a title and a valid expression, and while the SQL is still generating. If another metric already has the title, Mammoth adds a number to it (for example "Total sales 1").

### Available functions

**Quick dropdown (from the column header)**:

- Sum, Average, Standard Deviation, Min, Max

**Formula mode (full modal)**:

- `COUNT()`, `SUM("Column")`, `AVG("Column")`, `MIN("Column")`, `MAX("Column")`, `STDDEV("Column")`, `INT(expression)`, `ABS(expression)`
- Combine them with `+`, `-`, `*`, `/`, and parentheses

**SQL mode (full modal)**:

- Describe the metric in plain words and review the generated SQL expression. You can also edit the expression directly.

> **Note**: Column names in formulas must be wrapped in double quotes—for example, `SUM("deal_value")` not `SUM(deal_value)`.

## Formula syntax examples

In Formula mode, formulas use double-quoted column names. The formula editor shows "Looks good" when the syntax is valid.

Net revenue calculation:

```plaintext
SUM("gross_amount") - SUM("discount") - SUM("tax")
```

Performance against target:

```plaintext
(SUM("actual_quantity") / SUM("target_quantity")) * 100
```

Shows percentage achievement—format as percentage for display as 87.5%.

Conditional aggregation:

```plaintext
SUM("amount")
```

Add a condition such as `status` is `Completed` so the metric includes only completed transactions.

Multi-condition count:

```plaintext
COUNT()
```

Add conditions for `priority` is `High` and `status` is `Open` to count only records that are both high priority and currently open.

For calculations that need different conditions in one expression, such as a defect rate, use SQL mode and describe the metric in plain words.

![New Metric modal in Formula mode with the formula SUM of sales divided by SUM of quantity marked Looks good, a preview card titled Sales per unit showing 123.19, and Format, Title and Add More Details](https://docs.mammoth.io/api/v1/images/20261009_194914_NewMetricFormula.jpg)

## Metric card fields

When creating or editing a metric via the full modal, three text fields are available:

- **Title**: The primary label displayed on the metric card (required). It starts as "Metric" in the New Metric modal, and as "Sum of quantity_on_hand"-style text when you start from a column header. Fully editable.
- **Subtitle**: Optional secondary label shown below the value—useful for adding context such as "Q4 2024" or "West Region only."
- **Description**: Optional longer text, shown in smaller grey text under the value on the metric card. Hover the card text to read it in full.

## Metric card actions

A metric card shows its title (with a lock icon when locked), the value, the Subtitle, and the Description. A metric built from a plain-English description also shows that description in a row you can click to see the generated query, and a metric with a condition shows it as a filter summary. If a metric cannot be calculated, the card shows **Error**; hover it to see the reason.

Hover a card to show its toolbar of five action icons (they are disabled while the pipeline has an error):

| Icon | Action | Behavior |
| --- | --- | --- |
| Copy to clipboard | Copies the metric's title and current value | Instant—no modal. For example, `Total sales: 5.2M` |
| Edit (pencil) | Opens the full metric editor | Same modal as New Metric—expression, Title, Subtitle, Description, and formatting all editable |
| Duplicate | Creates a copy of the metric | Opens the "Duplicate metric" modal pre-populated with the original expression. Mammoth adds a number to the title (e.g., "Weight per unit sold 1"). Edit before submitting or accept as-is. |
| Lock | Freezes the metric against explore filters | The metric keeps the filters that were active when you locked it, and does not change when you change explore filters. Click the icon again to unlock it. |
| Delete (trash) | Removes the metric from the panel | Asks you to confirm before it deletes the metric |

To add another metric once the panel already has cards, use the blue **+** button at the bottom of the Metrics Panel. When you have multiple metric cards, drag a card by its header to reorder it within the panel.

![Metrics panel with a Sales per unit card showing 123.19 and a hover toolbar with Copy, Edit, Duplicate, Lock and Delete icons](https://docs.mammoth.io/api/v1/images/20261009_195010_MetricCardToolbar.jpg)

## Format your metrics

### Currency

Options: numeric (default), % (percentage), or currency—with a choice of USD ($), EUR (€), GBP (£), JPY (¥), or INR (₹). Controlled via the formatting toggle buttons in the creation popup and full modal.

### Decimal control

Use the arrow controls next to the decimal display (`< 0.00000 >`) to set precision from 0 to 5 decimal places.

### Short form display

Check "Display in short form" to convert large numbers to K, M, B format:

- 1,234,567 → 1.23M
- 45,600 → 45.6K

![New Metric modal with the Format currency menu open, listing the euro, dollar, yen, pound and rupee symbols](https://docs.mammoth.io/api/v1/images/20261009_194945_NewMetricCurrencyMenu.jpg)

> **Tip**: Use currency for revenue metrics, percentage for rates and ratios, and short form for large volume counts. Match formatting to how your stakeholders expect to see the numbers.

## Dynamic updates with filters

Metrics recalculate when you filter data through Explore Cards, giving you segmented analysis.

### How dynamic updates work

Initial state (all data):

- Total Revenue: $5.2M
- Average Deal: $12,340
- Order Count: 421
- Win Rate: 67%

After filtering (double-click "West" in the Region Explore Card):

- Total Revenue: $1.8M *(West region only)*
- Average Deal: $14,560 *(West deals are larger)*
- Order Count: 124 *(West order volume)*
- Win Rate: 72% *(West team performing better)*

![Animation comparing a View's metric values as a filter is applied to the Region card](https://docs.mammoth.io/api/v1/images/20260421_163433_comparisonshowingmetrics.gif)

### Lock feature for comparisons

Use the lock icon on a metric card to keep its value fixed while other metrics update with filters. Lock it while no filters are applied to keep the all-data value.

Example workflow:

1. Lock "Total Revenue" at $5.2M
2. Filter by Region = West
3. Create a new Revenue metric (unlocked)—shows $1.8M
4. Compare: $5.2M (Total) vs $1.8M (West) = West represents 35% of total revenue

![Animation of a metric card being locked in the Metrics panel of a View with a Region card](https://docs.mammoth.io/api/v1/images/20260421_164724_metric-lock1.gif)

## Real-world use cases

### Sales performance dashboard

Scenario: sales manager tracking daily team performance

Metrics created:

- Daily Revenue: `SUM("deal_value")`
- Average Deal: `AVG("deal_value")`
- Deals Closed: `COUNT()` with the condition `status` is `Won`
- Win Rate: SQL mode, described in plain words

Dynamic analysis: filter by "Q4 2024" to see fourth-quarter performance. All metrics update, revealing Q4 average deal size is 23% higher than the annual average.

### Manufacturing quality control

Scenario: quality assurance monitoring production line efficiency

Metrics created:

- Units Produced: `COUNT()`
- Defects Found: `COUNT()` with the condition `defect_severity` is not `None`
- Defect Rate: SQL mode, described in plain words
- Average Yield: `AVG("yield_percentage")`

Insight discovery: filter by "Night Shift" reveals 4.2% defect rate vs 2.1% overall average, triggering investigation into night shift procedures.

### Financial compliance monitoring

Scenario: compliance analyst tracking high-value transactions for regulatory reporting

Metrics created:

- Total Transactions: `COUNT()`
- High-Value Count: `COUNT()` with the condition `amount` > 10000
- Reportable Amount: `SUM("amount")` with the condition `amount` > 10000
- Compliance Rate: SQL mode, described in plain words

## Metrics panel vs other features

### Metrics panel versus Explore Cards

| Feature | Metrics panel | Explore Cards |
| --- | --- | --- |
| **Purpose** | Single-value KPIs | Data distributions |
| **Creation** | User-defined calculations | Added by you for any column |
| **Display** | Large numbers with labels | Charts and ranked lists |
| **Use Case** | Monitoring totals, averages | Pattern discovery, filtering |

Use Explore Cards to discover patterns, then create Metrics to track key numbers from those discoveries.

### Metrics panel versus View Insights

| Feature | Metrics panel | View Insights |
| --- | --- | --- |
| **Source** | Manual metric creation | AI-generated observations |
| **Control** | Full user control | AI determines insights |
| **Persistence** | Saved with View | Generated on demand, then saved until the View's data changes |
| **Focus** | KPI monitoring | Business intelligence |

> **Tip**: Create 3-5 core metrics for any dataset: total count, key sum (revenue or quantity), main average, and 1-2 business-specific ratios. These cover the basics of any dataset.

## Advanced metric patterns

### Segment comparison using lock

1. Create base metric (Total Sales)
2. Lock the metric—preserves original value
3. Apply filter (Region = East)
4. Create an identical unlocked metric—shows filtered value
5. Compare: $3.2M Total vs $1.1M East = 34% of business in East

### Running trend analysis

1. Create time-based metric (Monthly Revenue)
2. Filter by sequential months (Jan, Feb, Mar)
3. Watch metrics update for each period
4. Identify patterns (growth, decline, seasonality)

![View filtered to Region East, with the Metrics panel showing a locked Sum of deal_value 3,202,500.00 and an unlocked metric](https://docs.mammoth.io/api/v1/images/20260421_091837_Metric_with_lock_and_unlock_filter1.jpg)

## Troubleshooting

### Metric shows zero or error

**Problem**: Metric displays 0 or an error message.

**Solutions**:

- Verify you selected the right column
- Sum and Avg only work with numeric columns—check column type
- Review formula syntax—column names must be in double quotes: `SUM("column_name")`
- Check for null values that may affect the calculation

### Metric doesn't update with filters

**Problem**: Metric stays the same when applying filters.

**Solutions**:

- Check the lock icon—locked metrics do not update. Click to unlock.
- Verify the filter badge beside the Explore toggle shows an active filter
- Refresh the View if needed

## Next steps

- [Explore Cards—interactions](https://docs.mammoth.io/learn/explore-discover/explore-cards-interactions): combine multiple filters for deeper segmentation.
- [View Insights](https://docs.mammoth.io/learn/explore-discover/view-insights): let AI summarize patterns in your data.
- [Automations](https://docs.mammoth.io/learn/automations/): refresh data on a schedule to keep metrics current.

---
Source: https://docs.mammoth.io/learn/explore-discover/metrics-panel.md · Updated: 2026-10-13