SELECT
client.Geo.Subdivision1Name as state,
APPROX_QUANTILES(a.MeanThroughputMbps, 100)[OFFSET(50)] AS median_download,
COUNT(*) as test_count
FROM `measurement-lab.ndt.ndt7`
WHERE date >= "2024-03-01"
AND client.Geo.CountryCode = "US"
AND client.Geo.Subdivision1Name IS NOT NULL
GROUP BY state
ORDER BY state
Or to get the test count of a particular Subdivision, you could use this query:
SELECT
APPROX_QUANTILES(a.MeanThroughputMbps, 100)[OFFSET(50)] AS median_download,
COUNT(*) as test_count
FROM `measurement-lab.ndt.ndt7`
WHERE date >= "2024-03-01"
AND client.Geo.Subdivision1Name = "New York"
Hope this helps!