Semaphor
Filters

Global Date Filter

Apply one date range across every eligible card on a dashboard.

Overview

A global date filter lets you set one date range at the dashboard level and have every eligible card pick it up automatically, with no need to configure the same date filter card by card.

Think of it as the dashboard's default time window. You set it once, and every eligible card with a clear date field respects it.

Need to choose a different date field for each card?

Use a regular dashboard date filter with card mappings when you want to select each card's date field, include SQL cards, or add more than one independent date filter. Global Date remains the automatic primary time window for eligible config-driven cards.

Plays nicely with your card-level dates

If a card already has its own card filter date range on, say, order_date, the global range for that same field takes the lead while it applies, and the card's own range is kept safe and comes back when the global filter is cleared. Date filters on other fields keep working as usual. The two ranges are never merged, so a card never quietly shows a narrower window than you expect.


How it works

There are two ways to configure this:

  • On the dashboard, you add a global date filter. It automatically picks up each card's primary date field, so cards built on different datasets all filter correctly without any per-card setup.
  • On each semantic dataset, you mark one date field as the dataset's primary date field. This is the canonical date the global filter will target.

Which cards does this apply to?

The global date filter works with config-driven cards — the cards you build with the visual editor — whether or not they're on a semantic domain. If a card is on a semantic domain, you can set a primary date field on the dataset to tell the filter which field to use. SQL cards aren't touched by the global filter; they keep filtering exactly as their query defines.


Which date field each card uses (precedence)

When you add a global date filter, Semaphor picks which field to filter on for each card using a simple order of precedence. The goal is straightforward: cards that already have their own date behavior keep that behavior, and everything else picks up the dataset default.

  1. The card is already grouped by a date field. If the card breaks down its data over time (a trend over created_at, a monthly breakdown of order_date, etc.), the global filter targets that field.
  2. The card has a date field set for it. Single-value and aggregate cards can use a date field even when it isn't shown on the card.
  3. The dataset's primary date field. If the card is on a semantic domain and you've set a primary date field on the dataset, the filter uses that field.
  4. No date field to use. If none of these gives one clear field, the filter skips the card. On semantic-domain cards, that's usually a sign to set a primary date on the dataset.

When a card is skipped

A card with no clear date field simply keeps showing its own data. If a semantic-domain card you expected to follow the range doesn't, set a primary date on its dataset and it will pick the range up.


Set a primary date field on a dataset

Open a dataset with a date dimension in the semantic domain editor and toggle Set as primary date field on the column you want as its canonical date.

In YAML, it's a single key on the dataset:

datasets:
  - name: orders
    label: "Orders"
    primaryDateField: order_date
    fields:
      dimensions:
        - name: order_date
          label: "Order Date"
          dataType: date

The field you point to has to exist on the dataset and be a date or datetime type. If you rename the field later, the primaryDateField reference updates automatically.

For the full field authoring reference, see Datasets & Fields.


Add a global date filter to a dashboard

Open your dashboard in edit mode, open the filter side panel, and click Add global date filter at the top.

The filter shows up with a Global badge and a default title of Global Date. Click it to open its panel. Under Presets, Static or Relative, pick a range such as Last 7 days, This month, Year to date, or explicit start and end dates. The range applies to every eligible card immediately.

Default date ranges

You can save the dashboard with a sensible default range — for example, Last 30 days or This month — so it opens on the right window every time. Because the default is relative, it resolves freshly each time a viewer loads the dashboard.

Compare with another period

The Date filter can also turn on comparisons across the whole dashboard. Pick an earlier period once, and every metric that follows the Date filter shows the change, without you editing a single card.

  1. Open the Date filter and choose a range with a clear start and end.
  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.

While comparing, the chip names both: Today · vs same day last week. With the switch off, the panel is the picker alone.

Picks apply at once. A comparison pick closes the panel. Picking a range keeps it open while you're comparing, so a range and a comparison take one visit, and closes it when you're not. Switching comparison off, clicking away or pressing Esc also closes it.

Apply stays disabled, with the reason, while a custom step would land inside the range. If 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. It doesn't change the date range. The panel has no Clear button; the × on the chip clears the filter.

Which metrics follow it

Your selection reaches only metrics that follow the Date filter, which is each metric's default. A metric the author pinned to its own comparison, a step back or a target, keeps it, and one the author turned off stays off. The panel's footer names the cards it reaches that keep their own comparison: Revenue, Visits keep their own comparison.

Global Date is the primary comparison control, but not the only one. When it has no range with a start and end, or isn't on the dashboard at all, an eligible date filter on a field carries the comparison instead, with the same panel. As soon as Global Date has a range with a start and end again, it takes back over, including when it isn't comparing. See Which control wins for the full precedence.

Comparison waits for a real range

If the date range is All time, one-sided, an exact date, not between, or otherwise has no clear start and end, the comparison pauses and cards keep showing their current values. Pick a range with a start and end and the comparison comes right back.

A comparison always lines up the same elapsed stretch of each window. On July 11, for example, This month (July 1 to July 11) compares with June 1 to June 11 rather than all of June.

See Metric Comparisons for how baselines, visual support, and window behavior work in full.


Works alongside your other filters

The global date filter is independent of the other filtering mechanisms on a dashboard:

  • Card-subscribed filters ({{ filters | where }} in SQL queries) keep working exactly as before.
  • Dashboard controls ({{ param('id') }}) keep working exactly as before.
  • Date filters keep filtering rows in every case, whatever field they're on, and eligible ones supply their own comparison when Global Date doesn't govern.

All of them can be active at the same time. For the same resolved date field, Global Date supplies the comparison windows while it applies; a card's own saved range steps aside and returns when Global Date is cleared, while a dashboard date filter keeps filtering alongside it.

On this page