Skip to main content
Two Query features go past a single measure function: rolling measures, which compute a measure over a trailing window for every day, and measure filters, which drop rows by their measure value. This page covers both, with formulas built from rolling measures.

When to use

Rolling measures

A rolling measure computes a measure over the last X days for every day in the date range. It answers questions like “What are my weekly active users on a daily basis?” or “What’s the moving average for each day?”

Rolling options

There are three rolling options. Each one takes a number of days: pick a preset, or type your own.
Measure By dropdown for an Average measure with Rolling selected, showing a Rolling Average option set to 7 days and an Apply button next to the list of measure functions.

Build a rolling measure

  1. Build your measure in Query.
  2. Open the Measure By dropdown under the selected event. Click Rolling at the top right of the dropdown.
  3. Select a rolling option. Select a preset number of days, or enter your own, and confirm it (the screenshot shows an Apply button).
  4. Click Execute.

Compound rolling measures

You can build several rolling measures in one report and combine them in a formula.
Report with Measure A as Unique Users with Rolling Average 7 days and Measure B as Unique Users with Rolling Window 7 days, a formula F1 set to A/B, and the resulting daily ratio plotted as a line.
Formula covers formula syntax and limits.

Measure filters

A measure filter keeps or drops rows by the value of a measure. Use it to exclude outliers, or to avoid division by 0 when you break down a ratio.

How it works

In this example, a breakdown by status message has a long tail of small values.
Data table of event counts by Status Message, with three large values at the top and a long tail of values from 416 down to 0.
To focus on the top groups, add a measure filter of A > 1000. Under Report Filter, click Add filter > Measure Filter, then enter the condition. The table then keeps only the rows where measure A is over 1000.
Report Filter with a measure filter A > 1000 and the Add filter menu open showing Global Filter, Cohort Filter and Measure Filter, and a data table that now lists only three status messages.

MCP prompt examples

“Show me a rolling 7-day average of unique users per day for the last 30 days”
“Create a line chart of daily DAU/WAU: rolling 7-day average of unique users divided by a rolling 7-day window of unique users”
“Show event counts by status message for the last 7 days, only where the count is over 1000”