Trendline - where is the option?

Hey,
This seems like a stupid question, but I’ve done my homework, and top search hits for “trendline” date back to 2022, so I’ll ask anyway.

I am utterly unable to find the “trendline” option for my chart. I read somewhere that the option should be found under the “data” tab, while visualizing, and requires the data to be a timeseries (more on this later) - but when I group by TIMESTAMPTZ column (Postgres), I do not see any toggle under data in the left aside.

Furthermore, my chart is a timeseries, but wall-clock time is not of great importance to it. Does Metabase still require me to group by something like a TIMESTAMPTZcolumn? If this is still the case, then that seem overly restrictive? Often time series can be of discrete time, where the relative date distance between the points along the X-axis has no valuable meaning, what matters is the sequential nature of the data, in which cases plotting a trend line can still be of great value.

Grateful for any pointers where to find the option, and if possible, how to apply it to timeseries using discrete time (just a sequence of integers).

I am running metabase using the latest docker image metabase/metabase:latest currently whatever version it pointed to Sunday day before yesterday

After reviewing a few outdated documentation pages, i found the trend line option by help of Gemini. However, I am still unable to use a timeseries using discrete time

Currently in Metabase (57), the X axis must be a time series (as set under Axes → X-axis → Scale) for the Trend line checkbox to appear on the Display tab. Grouping is not strictly required.

A trend line where the X axis is non-linear is nonsensical; the slope will be non-linear, and then it’s a curve, not a line. Mechanically speaking, yes, you could compute a slope based on the number of X-axis values, but the trend will need interpretation.

Trolling through GitHub issues implies there is a auto-selection for line or curve fits. I haven’t seen Metabase plot a curve fit for a trend line, but it is apparently possible.

If Metabase can’t generate your trend, you can compute the trend in the database. PostgreSQL has the regr_ family of functions to compute linear regressions using arbitrary X and Y values (anything that can be expressed in floating point). You can also use Python functions that compute line fits using any method you can think of, including machine learning models.

Reference:

This GitHub issue is along the lines of what you’re asking for, give it a thumbs-up:

Who said X would be non-linear? I said I am interested in plotting a trend line for a timeseries using discrete time. That can be perfectly linear. It doesn't require any more “interpretation” than a timestamp would—after all, unix timestamps are also just discrete timesteps underneath. So no, there is nothing "nonsensical" about plotting trend lines for discrete time—it depends entirely on the nature of the inquiry at hand, and what one intends to explore.