Miss match in IM count

Hi Experts,

My requirement is to display the count of IM’s which was closed or opened in Last 30 days.

Currently I have a dashboard which shows this count. Below screenshot shows the same.


when i selected 65 below IM's was displayed with count.


But there is a miss match in count . Here the count is showing as 1237.

Below is the query given for pIe chart.

open.time>=date(tod()) - '30 00:00:00' or close.time>=date(tod()) - '30 00:00:00'

Any suggestion is appreciated to resolve this count miss match.