Semaphor

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.

PartQuestion it answersExample
Date fieldWhich date does this metric track?orders.order_date
Current windowWhich date range is showing?April 1 to April 30
BaselineWhat 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 metricWhat happens
OffThe metric never shows a comparison
Previous period, Previous year, or TargetThe metric uses that baseline
Inherit dashboard comparisonThe 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

  1. Open the visual editor and add a metric to a supported visual.
  2. 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.
  3. Select a date range with a clear start and end, from the Global Date control or on the card itself.
  4. Open the metric's settings and, under Comparison Type, choose Previous Period, Previous Year, Target, Off, or Inherit dashboard comparison.
  5. For a period comparison, set how far back to look and how to align the dates (covered in Baseline options below).
  6. 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.
  7. 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.

  1. Open the Global Date control and choose a date range with a start and end.
  2. Under Compare, choose Previous period or Previous year.
  3. 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 windowWithout To dateWith To date
July 1 to July 11June 1 to June 30June 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:

SettingOptions
Calculated asDifference, Percent change, Both, or Ratio
Percent/ratio precision0 to 6 decimal places
IndicatorArrow with badge, Arrow, Badge, or None
Sentiment colorOn or off, with your own increase, decrease, and no-change colors
LabelOne 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 ÷ comparison

Percent 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:

  1. A date shown on the visual, such as an axis or a time grouping.
  2. A date you configure for a single-value or aggregate visual, even if it isn't shown.
  3. 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.

VisualPeriod comparisonTargetWhat it shows
KPIYesYesCurrent value, previous or target value, and a change indicator
Bar and horizontal barYesNoCurrent and comparison bars
Stacked barYesNoCurrent and comparison series
Line, area, stacked area, combo, stacked lineYesNoAn earlier series drawn on the current dates
TableYesYesThe comparison value and your chosen presentation
Pivot tableYesNoComparison columns for each pivoted metric
BulletYesYesCurrent value with a period or target marker
Custom visualComparison data is providedN/AYour 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.

On this page