Metric Comparisons
Show how a metric is doing against a previous period, a previous year, or a target.
What metric comparisons do
A single number rarely tells the whole story. Revenue of $48,000 looks very different depending on whether last month was $40,000 or $60,000. A metric comparison puts the current value next to a baseline, so viewers see the change, not just the number.
You can compare a metric with:
- the previous period (this month vs. last month),
- the same period a previous year (this April vs. last April), or
- a fixed target you set.
Every comparison comes down to three things: which date the metric uses, which date range is active, and what to compare against. Change the active date range and both windows move together; the baseline you picked stays the same.
| Part | Question it answers | Example |
|---|---|---|
| Date field | Which date does this metric track? | orders.order_date |
| Current window | Which date range is showing? | April 1 to April 30 |
| Baseline | What do we compare it with? | Previous period (March) |
Who sets comparisons
Authors and viewers each control a different part, and an author's choice always wins.
As an author, you set the baseline on each metric. You can pick a specific baseline, turn comparison off, or leave the metric set to Inherit dashboard comparison so it follows whatever viewers choose. You can also turn off inheritance for an entire visual.
As a viewer, you can pick Off, Previous period, or Previous year from the Global Date control. Your choice only reaches metrics the author left set to inherit. It never changes a metric the author configured directly.
| What the author set on a metric | What happens |
|---|---|
| Off | The metric never shows a comparison |
| Previous period, Previous year, or Target | The metric uses that baseline |
| Inherit dashboard comparison | The metric follows the viewer's Global Date choice |
Viewers can explore, not override
A viewer can turn comparisons on across a dashboard without edit access, but cannot replace a metric's set baseline or switch on a metric the author turned off. Comparisons a viewer chooses never rewrite the saved dashboard.
Set a comparison on a metric
- Open the visual editor and add a metric to a supported visual.
- Make sure the metric has a date to compare over. That can be a date shown on the visual (such as a Trend By field on a KPI), a date you configure for the visual, or the dataset's primary date field.
- Select a date range with a clear start and end, from the Global Date control or on the card itself.
- Open the metric's settings and, under Comparison Type, choose Previous Period, Previous Year, Target, Off, or Inherit dashboard comparison.
- For a period comparison, set how far back to look and how to align the dates (covered in Baseline options below).
- Choose the metric's Favorable direction so the color and arrow mean the
right thing:
- Higher is better is the default.
- Lower is better suits costs, errors, latency, and similar metrics.
- Neutral shows the direction without calling it good or bad.
- Use the visual's Comparison section to change how the result looks.
Some metrics decide their own direction
If a metric's favorable direction is defined in your semantic model, that setting is used and the editor shows it as managed, so a per-visual choice can't quietly disagree with it.
Let viewers compare across the dashboard
The Global Date control lets a viewer apply one comparison across every eligible visual at once, without opening any card.
- Open the Global Date control and choose a date range with a start and end.
- Under Compare, choose Previous period or Previous year.
- If you want, adjust how far back to look, turn To date on or off, or turn on Match weekdays.
The control tells you how many visuals will pick up the selection and how many have their own author-set comparison. Choose Reset to clear your selection and return to the dashboard's saved default, without changing the date range.
Baseline options
Previous period
Compares the current window with the equal-length window right before it. A full April compares with March; an arbitrary 14-day range compares with the 14 days before it.
To look further back, set Periods back above 1. With a monthly window, 2 compares April with February.
Previous year
Compares the current window with the matching window one or more years earlier. The dates are worked out in the dashboard's timezone, and follow your fiscal calendar if your model defines one.
Set Years back above 1 to compare against an earlier year.
Target
Compares a metric with a fixed number you choose. A target belongs to a specific metric, so authors set it directly and it isn't offered in the viewer's Global Date control. Targets are available on KPI, table, and bullet visuals.
Compare incomplete or weekday-sensitive periods
To date
When the current window isn't finished yet, comparing all of it with a full prior window isn't fair. To date lines up the same elapsed stretch of each.
For example, on July 11:
| Current window | Without To date | With To date |
|---|---|---|
| July 1 to July 11 | June 1 to June 30 | June 1 to June 11 |
Comparisons a viewer starts from Global Date use To date by default. A comparison an author sets keeps whatever the author chose.
Match weekdays
Some patterns depend on the day of the week more than the calendar date. Match weekdays shifts the whole comparison window as one block so weekdays line up, instead of matching the exact dates. The resolved dates in the comparison details are always the source of truth for what was compared.
Choose how comparisons look
The visual's Comparison section controls presentation. Supported built-in visuals share these settings:
| Setting | Options |
|---|---|
| Calculated as | Difference, Percent change, Both, or Ratio |
| Percent/ratio precision | 0 to 6 decimal places |
| Indicator | Arrow with badge, Arrow, Badge, or None |
| Sentiment color | On or off, with your own increase, decrease, and no-change colors |
| Label | One label, or separate labels for increase, decrease, and no change |
The math behind each mode:
Difference current − comparison
Percent change (current − comparison) ÷ | comparison |
Ratio current ÷ comparisonPercent change divides by the comparison value's size, so the sign of the percentage follows the direction of the change even when the baseline is negative.
When the comparison value is exactly zero, Difference still works, while Percent change and Ratio are shown as unavailable. Semaphor never fills in a zero or an infinite percentage to hide that.
Which date and date range a comparison uses
Most of the time a comparison just works. When it doesn't appear, it's usually because of the date field or the date range, so it helps to know how each is chosen.
The date field
Each visual compares against one date field, picked in this order:
- A date shown on the visual, such as an axis or a time grouping.
- A date you configure for a single-value or aggregate visual, even if it isn't shown.
- The dataset's primary date field.
If none of these points to one clear field, or a visual pulls dates from several datasets and the choice is ambiguous, the visual can't compare until you pick a date. Semaphor won't guess by grabbing the first date it finds.
Time-series charts need a date on the axis, because the earlier values are drawn onto the current dates. KPIs, category charts, and table metrics can compare using a configured or primary date without showing it.
The date range
Period comparisons need a range with both a start and an end.
When the Global Date range and a card's own date range point at the same field:
- The Global Date range is what the comparison uses.
- The card's range stays saved, and takes over again when Global Date is cleared or doesn't apply.
- Date filters on other fields keep working as ordinary filters.
The two ranges are never combined. Combining them could quietly shrink the window and show a comparison that doesn't match what's on screen.
A few date settings can't define a comparison window: a single-sided condition (after a date, before a date), an exact-date match, not between, All time, or a reversed range. The visual still shows its current value; the comparison simply waits until there's a range with a start and end.
Where comparisons are available
Support depends on how a visual presents its numbers as much as on the visual type.
| Visual | Period comparison | Target | What it shows |
|---|---|---|---|
| KPI | Yes | Yes | Current value, previous or target value, and a change indicator |
| Bar and horizontal bar | Yes | No | Current and comparison bars |
| Stacked bar | Yes | No | Current and comparison series |
| Line, area, stacked area, combo, stacked line | Yes | No | An earlier series drawn on the current dates |
| Table | Yes | Yes | The comparison value and your chosen presentation |
| Pivot table | Yes | No | Comparison columns for each pivoted metric |
| Bullet | Yes | Yes | Current value with a period or target marker |
| Custom visual | Comparison data is provided | N/A | Your renderer decides how to show it |
Pie, donut, polar, radar, scatter, bubble, funnel, tornado, range, treemap, heatmap, text, and map visuals don't offer comparison settings yet.
Raw SQL cards don't get built-in comparisons. Columns you name current,
previous, or delta in your own SQL are treated as ordinary results.
When a comparison can't run
When a comparison can't be worked out, the card keeps showing its current value and explains why rather than showing a wrong or empty number. The usual reasons:
- No date range with a start and end is selected.
- No single date field can be resolved for the visual.
- Several possible date fields are ambiguous.
- There isn't enough history to fill the comparison window.
- The visual type or a raw SQL card doesn't support comparisons.
Missing history stays missing; it's never turned into zero. In a grouped result, a category can still appear for the current window even when it has no match in the comparison window.
To see exactly what a live comparison used, open the Comparison badge on the card. It shows the baseline, whether it came from the author or from the viewer's selection, and the resolved current and comparison date ranges.
Comparisons in saved views, embeds, and exports
A dashboard's date range and comparison selection are saved as two separate parts of the same setting. Lenses, embed inputs, scheduled snapshots, exports, PDFs, and Briefing attachments all preserve the comparison that was in effect for that run, so a saved or shared view shows the same numbers later.
Choosing a comparison as a viewer never changes the visual's saved configuration.