Semaphor

Metric Comparisons

Show how a metric is doing against an earlier period, a target, or another metric.

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 week, month, quarter or year back (this April vs. last April),
  • any custom step back, such as 2 years or 4 weeks,
  • a fixed target you set, or
  • on a two-metric KPI, the other metric.

Every period 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 step 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 month (March)

Follow, pinned, or off

Each metric's comparison is in one of three states. The author picks the state; a viewer's Date filter only reaches metrics that follow it.

StateWhat the metric shows
Follows the Date filter (the default)Whatever comparison the Date filter has now, or none when it isn't comparing
Pinned to its own comparison, a step back or a targetThat comparison, whatever a viewer picks on the Date filter
OffNo comparison, ever

So on one card, Revenue can follow the Date filter while Returns stays pinned to Same month last year. When a viewer switches the Date filter to Previous month, Revenue changes and Returns doesn't.

Viewers can explore, not override

A viewer can compare across a dashboard without edit access, but can't replace a pinned comparison or turn on a metric the author turned off. Comparisons a viewer chooses never rewrite the saved dashboard.

Data variables, the values you place in text cards and Documents, never follow the Date filter. A variable compares only with the step it names, such as the period before or last year.

Set a comparison on a card

  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 Date filter or on the card itself.
  4. Open the visual's Comparison section and set each setting below.

Once the card has run, the dates the chosen comparison covers show under Compare with.

Compare with

Set per metric. The choices:

  • The Date filter's comparison: follow it. The choice shows what the Date filter compares with now.
  • Off: no comparison.
  • The steps offered for the window, named for it, such as Previous month or Same month last year. See Baseline options.
  • Custom…: any number of days, weeks, months, quarters or years back. For a step by years, turn on Match weekdays to line up weekdays.
  • Target: a fixed number. Available on KPI, table and bullet visuals.
  • Other metric · name: on the first metric of a KPI with exactly two metrics, compares the first metric with the second.

How the change shows

The rest of the section sets presentation, in this order:

SettingOptions
Shown asChange %, Change, Both, or Ratio
Decimals0 to 6, or Auto (the default). Shown only for Change % and Ratio
IndicatorArrow + badge, Arrow, Badge, or None
Higher isBetter, Worse, or Neither, one per comparing metric (named when there are several)
ColorsOn or off, with your own Up, Down and No change colors
LabelEmpty uses the comparison's own words. Turn on Different label per direction for separate increase, decrease and no-change labels

Higher is decides what the colors mean: with Better, Up is the good color; with Worse, such as for costs, errors or latency, Up is the bad color; Neither shows the direction without calling it good or bad.

An empty Label follows the Date filter: when a viewer switches to Same month last year, the label changes with it. A label you type stays as written.

Some metrics decide their own direction

If a metric's direction is set in your semantic model, Higher is shows it fixed, so a per-visual choice can't quietly disagree with it.

The math behind each Shown as:

Change    current − comparison
Change %  (current − comparison) ÷ | comparison |
Ratio     current ÷ comparison

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, Change still works, while Change % and Ratio are shown as unavailable. Semaphor never fills in a zero or an infinite percentage to hide that.

Cards saved with the earlier switches

Cards used to carry switches named Inherit Global Date comparison, Show comparison and Enable metric comparison. They're gone; each metric's Compare with now says it all. A card saved with them keeps showing what it did:

  • A card saved with Show comparison off shows and runs no comparison. Each metric reads Off.
  • A card saved with inheritance off shows each metric that had no comparison of its own as Off.

Pick a comparison on such a card and Semaphor sets each metric's own state and drops the old switch.

Let viewers compare across the dashboard

The Date filter lets a viewer apply one comparison to every metric that follows it, without opening any card. That works on Global Date and on a date filter on a specific field.

When the filter is comparing, its chip names both the range and the comparison: Today · vs same day last week.

  1. Open the Date filter. The panel shows the picker: Presets, Static and Relative.
  2. Turn on Compare with an earlier period in the panel's footer. The comparison starts at the previous period, and a Compare with column opens beside the picker.
  3. Pick a row. Each one is named for the range and shows the dates it compares with, such as Previous 7 days — Oct 31 – Nov 6, until 7:42 PM.
  4. For a step not listed, choose Custom…, enter how many days, weeks, months, quarters or years back, and choose Apply. A step by years also offers Match weekdays.

Picks apply at once:

  • Picking a comparison closes the panel.
  • Picking a range keeps the panel open while comparing, so you can set a range and a comparison in one visit. When not comparing, it closes.
  • Switching comparison off closes the panel, as do clicking away and Esc.

Apply stays disabled, with the reason, while a custom step would land inside the range. When you pick a new range and the chosen step lands inside it, the comparison falls back to the previous period and the panel says so: Same day last week lands inside this range: comparing with the previous month.

Reset appears once you've changed the comparison and returns it to the dashboard's saved default. To clear the filter itself, use the × on its chip.

On Global Date, the panel's footer names the cards it reaches that keep their own comparison: Revenue, Visits keep their own comparison.

Compare from a date filter

A dashboard doesn't need Global Date to offer comparisons. A date filter on a specific field, such as an Order Date filter, has the same panel and Compare with column.

The comparison reaches visuals whose comparison date is that exact field from the same dataset. Each visual's Comparison badge names the filter it follows.

Where your selection applies

Say you've chosen Previous period on Global Date or a date filter:

The metric's stateWhat the visual shows
Follows the Date filterYour comparison, with the badge naming the filter it follows
Pinned to a step back or a TargetThe author's comparison. The badge says it was set by the author
OffNo comparison. Your selection never switches it back on

Which control wins

A metric's own state always comes first, as the table above shows. When more than one date control could supply the comparison for a following metric, the dashboard picks one owner.

The scenarios below assume a Sales visual whose date field is Order Date.

ScenarioRows the visual showsComparison used
Global Date: June, comparing with the previous period. No Order Date filter.JuneJune vs. May, from Global Date
No Global Date. Order Date filter: June, comparing with last year.JuneJune vs. June last year, from the Order Date filter
Global Date: June, comparing with the previous period. Order Date filter: May.Rows in both June and MayJune vs. May, from Global Date. The filter's range keeps filtering, so contradictory ranges can leave no rows
Global Date: June, not comparing. Order Date filter: May, comparing with last year.Rows in both June and MayNone. Global Date's choice not to compare wins while its range applies
Global Date cleared or All time. Order Date filter: June, comparing with the previous period.JuneJune vs. May, from the Order Date filter
Global Date cleared. Two date filters both target Order Date.Rows allowed by both filtersNone while the match is ambiguous
A Ship Date filter is set, in addition to any of the above.Also narrowed by Ship DateUnchanged. A filter on another field never supplies the comparison

Ownership decides which control supplies the comparison windows and baseline, never which filters apply: every date filter keeps filtering rows the whole time. A date filter's saved comparison stays put while Global Date governs, and takes over again as soon as Global Date is cleared.

Baseline options

The menu names each choice for the window you picked, and lists only the steps that make sense for it.

WindowChoices
TodayPrevious day, Same day last week, Same day last month, Same day last quarter, Same day last year
Last 7 daysPrevious 7 days, Same days last month, Same days last quarter, Same days last year
This monthPrevious month, Same month last quarter, Same month last year
This yearPrevious year

A step that would land inside the window itself, such as a week back from this month, isn't offered. Custom… in the card editor steps any number of days, weeks, months, quarters or years back; if the step lands inside the window, the visual says so and shows no comparison.

The 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.

The same day or period last week, month, quarter or year

Moves the whole window back by one week, month, quarter or year. On Today, Same day last week compares a Thursday with the Thursday before. The dates are worked out in the dashboard's timezone, and follow your fiscal calendar if your model defines one.

Use Custom… to step further back, such as 2 years or 4 weeks.

Target

Compares a metric with a fixed number you choose. A target belongs to a specific metric, so authors set it on the card and it isn't offered on the Date filter. Targets are available on KPI, table, and bullet visuals.

Other metric

On a KPI with exactly two metrics, the first metric can compare with the second, such as Revenue against Budget. Choose Other metric · name under the first metric's Compare with. This compares the two values shown; it isn't a period comparison, so the Date filter doesn't change it.

Compare incomplete or weekday-sensitive periods

Windows that are still running

When the current window isn't finished yet, comparing all of it with a full prior window isn't fair, so every comparison lines up the same elapsed stretch of each window, to the same time of day. There's nothing to turn on.

For example, at 7:19 AM on November 12:

Current windowCountsCompared with
Last 7 daysNovember 6 to 12, until 7:19 AMOctober 30 to November 5, until 7:19 AM
This monthNovember 1 to 12, until 7:19 AMOctober 1 to 12, until 7:19 AM

On a date column with no time of day, both windows count whole days: November 1 to 12 compares with October 1 to 12. A window that has already ended, such as Last month, compares with the whole earlier period.

The earlier window is never longer than the current one. When a step crosses a shorter month or February 29, the earlier window ends early instead of taking in extra days: at noon on March 1, 2025, This year compares with January 1 to noon on February 29, 2024. Whole months, quarters and years keep their own lengths, so March still compares with all of February.

Match weekdays

Some patterns depend on the day of the week more than the calendar date. For a step by years, Match weekdays moves the window back 52 weeks (364 days) instead of to the same dates, so a Monday compares with a Monday. A step by weeks already keeps the weekday. The dates shown with the comparison are always the source of truth for what was compared.

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 comparison window always comes from one control; two ranges are never blended into a single window, because a blended window could show a comparison that doesn't match what's on screen.

A date filter you add to the dashboard can also supply the window. When Global Date has no range with a start and end, a date filter that matches the visual's date field exactly, same field from the same dataset, takes over the comparison with its own range and comparison. See Which control wins for the full precedence.

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 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, the earlier 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
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 and text 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.
  • Two dashboard date filters match the same date field, so neither can own the comparison.
  • The step lands inside the current window.
  • 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, where it came from (set by the author, the dashboard date, or a named date filter), and the current and comparison date ranges.

Comparisons in saved views, embeds, and exports

A dashboard's date range and comparison are saved as two separate parts of the same setting. Embed inputs, scheduled snapshots, exports, PDFs, and Briefing attachments all keep 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