All posts

Compare any period to the one before

By Event Horizon Data
product

Almost every number raises the same second question. Revenue was 120k this month. Compared to what? Up from last month, or down from the same month last year? That comparison is what turns a number into a decision, and it is the part people most often rebuild by hand in a spreadsheet.

You do not have to. The builder does it for you, and this post is about where it is and how to read it, because the name we used to give it hid what it was.

It is one control, not a formula

Open a time chart in the widget builder and look for Calculations over time. Add one and pick Change or % change. That is period over period. No expression to write, no second query to line up next to the first.

We used to file this under "window functions", which is accurate and useless: it is the database term, and nobody opens a menu called that looking to compare two months. It now says what it does.

You choose what to compare against

Next to the calculation is Compare to, with three choices:

  • Previous period: the bucket just before this one.
  • Same period last year: the equivalent bucket a year back.
  • Custom: any number of periods back.

The comparison always follows your chart's own time grain, so one control covers all the usual cases. Monthly buckets with "previous period" is month over month. Monthly buckets with "same period last year" is year over year. Quarterly buckets with "previous period" is quarter over quarter. Weekly buckets, week over week. You are not picking an acronym, you are picking a chart grain and a step back.

It draws as its own line

The comparison does not replace your metric, it joins it. You see this period's value and its change side by side, so the trend and the delta read together on one panel. Give it a label and that is what the legend shows.

An honest blank when there is nothing to compare

In the first periods of a series there is no earlier period to compare against. Rather than invent a number, the change comes back blank, which is the truthful answer: there is nothing there yet. A percentage with no base is left empty for the same reason.

One thing worth knowing: the comparison steps back along the periods that are actually in your data, so keep the series continuous. On a dense timeline with no skipped months, a year-over-year step is exact. If a period is missing entirely, the step lands on the nearest one that exists, so a gap-free series is the one to trust for an exact year-ago read.

That is the whole feature: pick a grain, pick what to compare against, read the change next to the number. The second question, answered in the same chart as the first.