How to Compute a Moving Average in BigQuery Using SQL

Smooth out variations, spot trends, and visualize them in Data Studio

Romain Granger
Towards Data Science
6 min readFeb 10, 2022

--

Stock market station (Credits: https://unsplash.com/@behy_studio)

The problem

When looking at time-series data, decisions can be influenced by random, short-term fluctuations (price of a cryptocurrency, number of Covid-19 cases reported).

--

--

📊 Data Scientist | SQL, BigQuery, Python | Follow me to learn about SQL and data-related topics. Thank you so much for your support!