I'd like to add a vertical reference line in a line chart at the position of the current month. Any way to do this?
Thanks!
I'd like to add a vertical reference line in a line chart at the position of the current month. Any way to do this?
Thanks!
The Calculated Field below (where Date represents the name of the Date field, and Metric, the name of the current metric) adds a Bar on the current month:
Date; Type: Year MonthMetricTodayIF(DATETIME_TRUNC(Date, MONTH) = DATETIME_TRUNC(TODAY(), MONTH), 1, NULL)
Editable Google Data Studio Report (Embedded Google Sheets Data Source) and a GIF to elaborate:
You can use this example below (borrowed from here). After you change the date to a number, you can put this new value on the right axis and make it a bar.
CASE
WHEN CAST(FORMAT_DATETIME("%Y%m%d", Date) AS NUMBER ) = [YOUR DESIRED DATE] THEN 1
ELSE 0
END