Trend chart, what does the plot need to look like?

Hello,

I’m confused as to who the data must be structured to use the Trend chart properly. I’d like to display a Revenue number like in the example Trend | Metabase Documentation and compare with the previous year, and the year before that.

  • Do I need to have one year per column?
  • Do I need to compute the % increase/decrease in SQL?

Below are dummy data.

Is this the format to have?

Is this the format to have?

Is this the format to have?

Is this the format to have?

Yes. Use the first table format.

No, it will calculate the change for you.

Hey Doug
Thanks for the help.

Still confused here.
If I do one year per column the visualization is not working.

Oh, the year needs to be a date (2020-01-01), the date column must have a date semantic type, and you need to add a Summarize step so the trend knows how to calculate the values (sum of revenue by date::year works). The summarize by year will trim off the month and day.

Ah, my bad, I did realize this column invoicing_year was an integer and not a date.

Now I have it working

Thanks again

1 Like