Show data from the last workday


i am new to grafana and am using Grafana v10.4.1 (d3ce857c0e) on windows.

I want to visualize Data for machines, and want to show the metrics from the last
production day. I can do this by setting the time to now-1d, and if i want could filter it to the times I want. No problem here.

That works finde, until monday comes around. Because then I see data from Sunday (now-1d), but I want to show the data from friday. I dont really care for holidays in the first place, just the weekends would be nice to filter out. Has anybody an idea for me?

Is there something to calculate the last workday?
Or show the last day with data available?
I am open for ideas.

Thank you!

1 Like

There are many different relative time ranges supported but I don’t think there’s a way to do this specific thing, other than to use the datepicker and simply select the date as the previous Friday in a range.

There are a lot of cultural differences here between locations in the world, and it’s not at all obvious that if you’re on a Monday, that the previous Friday was the last work day. In the case of the “fiscal year” relative range, there’s even an option in Grafana to change the start of the fiscal year, because commonly people have different ones. Setting to “the last work day” is a very locally contextual setting that I imagine would be pretty hard for Grafana to support in a general way.

This related thread though shows some advanced tricks with the time range specifier, and you might find some help there, though the solutions I see there are not exactly what you’re after


Thank you for the fast reply.
I did infact read the other thread, and know what is possible.

The information you provided is understandable, and I did think that there would be no easy path.
But its better to ask, then not.

Thank you very much!

1 Like

not a solution but you can also filter out saturdays and sundays from your data:


That is very nice to know! Thanks for this information!

1 Like