Grafana populating incorrect data

I made a Loki-record ruler, which sends data to Prometheus API to store data for a long time. Now the problem is, whenever I see the data through grafana through Prometheus data source. The data is not populating correctly. when I see 1-day data its shows some value, when I increase the time period from 1 day to 2,3,7d. The data value is decreasing in the total count. This is the problem, in actuality the total value will increase if I increase the time interval from 1d to 5day.help asap