Median

MEDIAN

Explore this snippet with some demo data here.

Description

BigQuery does not have an explicit MEDIAN function. The following snippet will show you how to calculate the median of any column.

Snippet :scissors:

Use the following snippet to create your median function in the BigQuery console:

PERCENTILE_CONT(<COLUMN>, 0.5) OVER() as median

Usage

Use the MEDIAN syntax in a query like: