How to compare two different time periods on Metabase?

Hi community,

I was wondering how do I compare two different time periods. (see below)

This graphic has data from 2016 and 2017.

Is it possible to stack 2016 and 2017 data to better compare?


1 Like

Hi, I am able to do it in SQL syntax, you have to extract the day values (or week values) without the year as a new column, then you can group them.
I don´t think you can do it with the metabase query builder, unless you have a field already containing only week numbers without additional information (like year).

Hope that helps, Eva

Yup, that’s what I thought. Danke Eva.

And yes I could do it via SQL - But still - I think its an important feature for Metabase to have.
A period-on-period comparison is a bread and butter for analytics

Turns out there is already a thread on it:

@maz - since I saw your comment there, it might help to look how google data studio has done it.
The page gets another control with which one can manipulate the dates

1 Like

Completely agree, it would be cool to have that as a standard feature :slight_smile:

It would work in the query builder when we would be able to select the date field in the “grouped by” section more than once: then you could group your query by date: month of year (what gives you only the month) and date: year.

Cheers, E

100 times +1 for this feature! This has forced me to write a lot of custom SQL-queries that otherwise could easily have been created by using the standard query builder.

(With that said I’m still madly in love with Metabase <3)

1 Like

This does indeed seem like a standard feature, has this been built already? I can’t make it work currently in Metabase.

It’s currently not possible as a click-and-compare function, but there’s several different requests - I think the closest one to this would be the following issue - go and upvote by clicking :+1:

But you can hack something together, where you create two questions and use the Group By Week of year

And then combining the two questions into one card on the dashboard

1 Like