Trends visualisation with filter

Hi,

I tried to create trend visualization with question, it works well, but when i want to filter it in dashboard filter, it display me that there is no comparison vs previous data.

Capture d’écran 2023-12-04 à 14.22.31
Capture d’écran 2023-12-04 à 14.22.34

I tried the same visualization with native request (mongodb), and im facing with a new problem, Metabase tell me that i need to aggregate by a time field, it's already done.
I tried limit my request, i tried date field to be the first field, i tried convert date, obviously to date format, i tried to exclude null values, i also used the UI to generate native query from the question that display trend visualization


here is my native query

[
      {
    "$match": {
      "created_at": { "$exists": true, "$ne": null }
    }
  },
  {
    "$group": {
      "_id": {
        "created_at": {
          "$dateTrunc": {
            "date": "$created_at",
            "unit": "month",
            "timezone": "Europe/Paris"
          }
        }
      },
      "count": {
        "$sum": 1
      }
    }
  },
  {
    "$project": {
      "_id": false,
      "count": true,
            "date": {
          "$convert": {
              "input": "$_id.created_at",
              "to": "date"
          }
      },
    }
  },
    {
    "$sort": {
      "date": -1
    },
  },
  {
      "$limit": 2
  }
]

Thanks for you help

Hi, we're working to make this happen in v49. What's the data you see in the table (collection in this case) when the query is run?

Hi Luiggi,

Here is data i see when query is run
I added a limit of 2 to have only current value VS previous value, i also tried without limit