Explore this snippet with some demo data here.
BigQuery does not have an explicit
MEDIAN function. The following snippet will show you how to calculate the median of any column.
Use the following snippet to create your median function in the BigQuery console:
PERCENTILE_CONT(<COLUMN>, 0.5) OVER() as median
MEDIAN syntax in a query like: