$timeFilter + Last non null value


I’m using amazon managed grafana. My data source is Amazon Redshift and making use of SQL queries to build my dashboard.

What I want to achieve:

I have query with grafana macro $timeFilter which selects the time range specified in date & time and picker. Sometimes there is no data in database for a particular timerange and in these situations I want to the dashboard to display the last NON NULL values.

This feature from value option doesn’t seem to work. I’m guessing it cannot override the result from the query.

Can anyone suggest a way or if something is missing.


This feature works if there is some non-null data within the specified time range. If your query returns no data, last value can’t be shown.

You can override time range for particular panels if needed (for example, to make time range wider than selected in picker):
Query options

@ebabeshko thanks for your input. I played withTime shift and looks like temporary workaround. There’s one problem here the returned values (one of them is a timestamp column) are not consistent. Ex: My query is returning last non null value from the specified time range, Lets say my specified time range is 1h and no data is being displayed. Now when I apply timeshift of 2h I get value A and when I apply timeshift of 3h I get value B. This is something I’m not understanding and hence will not solve my problem.