Year to date comparisons in widgets

Year to date comparisons in widgets

Hi,

I want to know how to configure a widget to compare a metric's current value against its value in the previous year (at the same day/month point of time).

For example, cumulative revenue from Jan 1st to June 20th 2024 compared to the same period last year (cumulative revenue from Jan 1st to June 20th 2023).

Is it possible to do this in a widget? I can do it in a chart...

Many thanks,
Damian