Multiple location failure count

Hi,
We are working on custom dashboard. We are not able to find the outage count (Outage count is considered only when at a particular point of time ping checks fail for all location). So far, I can count the no. of individual locations where my ping checks fail but that’s not satisfying our needs. Please guide us.

we are using this query as of now SELECT count(locationLabel) FROM SyntheticCheck WHERE monitorName = 'xxx' and result!='SUCCESS'

In this query we need to add a condition that when my ping checks is failing from all the locations at that point of time then only to increment the outage counts. Please guide me how to resolve it

Thanks,