How to obtain differences when data is not updated in real time

I have set up prometheus to GET data from a certain data source on a minute-by-minute basis.
However, that data source only updates data once every 5 minutes.

What is the query to display the natural number of increases in this case?
I want to get the value equivalent to need-avg in EXCEL.

image
With the irate function, a spike occurs the moment a value is updated, as shown in the image above.
rate(any_data{}[5m])

image
With the rate function, zero occurs at the moment the value switches.
irate(any_data{}[5m])