Subtract 2 different Counter Metrics

Hi,

We have counter metrics on prometheus , we used the below query to get the total request based on the request URI. We need to perform pie based visulaization.

nginx_http_response_count_total{request_uri="/test"} - nginx_http_response_count_total{request_uri="/test"} offset $__interval > 0

The other query we need is difference between the count of request uri (test1 - test)

(nginx_http_response_count_total{request_uri="/test1"} - nginx_http_response_count_total{request_uri="/test1"} offset __interval > 0) - (nginx_http_response_count_total{request_uri="/test"} - nginx_http_response_count_total{request_uri="/test"} offset __interval > 0
)

But the above wont work. Is there anyway to get that query work. Without subract it showing correctly