Sum values for a day

Good evening.
I am pulling metrics from prometheus source for k8s. The simple query is kube_pod_container_status_terminated_reason which returns metrics with timestamp,namespace, pods etc with a value for each timestamp for the selected duration in grafana. Is it possible for me to aggregate it by day (sum values for the entire day) based on namespace?
I have tried various transformations unsuccessfully so far and looking for some help.

Thanks in advance.