How to Forecast Sales in Looker

Cody Schneider••8 min read

Building a reliable sales forecast can feel like trying to predict the weather - sometimes you get it right, but you’re often left scrambling when reality doesn't match your prediction. If you’re using Looker, you're already sitting on a goldmine of historical data that can help you create surprisingly accurate sales forecasts right inside the platform. This guide will walk you through a few different ways to project future sales in Looker, from simple, built-in features to more advanced custom models.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

First, Get Your Data in Order

Before you build any forecast, the quality of your input will determine the quality of your output. This principle of "garbage in, garbage out" is foundational to any data analysis. To create a meaningful sales forecast in Looker, you need a clean, consistent dataset of historical sales records.

Here’s what you should have locked down in your data model:

  • A Time Dimension: You need a clear date or timestamp field for every sales record. This could be an order date, a subscription start date, or a deal close date. Ensure it's consistently formatted.
  • A Sales Measure: This is the metric you want to forecast, such as total revenue, gross merchandise value (GMV), or the number of units sold.
  • Sufficient Historical Data: The more historical data you have, the better. At a bare minimum, you need enough data to identify trends and seasonality. Aim for at least 1-2 years' worth of records if possible.

With clean, accessible data ready in a Looker Explore, you can move on to the actual forecasting methods.

Method 1: Using Looker’s Built-in Forecasting Feature

For a quick, high-level projection, Looker’s built-in forecasting function is your most direct route. This feature is part of the visualization settings and extends a trend line into the future based on your historical data. It’s perfect for getting a directional sense of where sales might be headed without writing any code.

Here’s how to set it up step-by-step:

1. Create Your Base Chart

Start in a Looker Explore that contains your sales data.

  • From the field picker on the left, select your time dimension (e.g., Order Created Date, grouped by Month) and your sales measure (e.g., Total Sale Price).
  • Click Run to generate the data table.
  • Under the Visualization tab, select a line chart, column chart, or scatterplot. A line chart is usually best for showing trends over time.

You should now see a chart displaying your historical sales by month.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

2. Add the Forecast

Now, let's add the predictive layer.

  • Click the Edit button (the gear icon) in the top-right corner of the visualization pane to open the settings menu.
  • Navigate to the Y tab, which controls the y-axis settings.
  • Scroll down until you see the Trend Line section. Check the box to add a trend line to your chart.
  • Below the trend line options, you'll find the Forecast section. Check the box next to Forecast.
  • In the Forecast Length field, enter the number of periods you want to project into the future. For example, if your data is grouped by month, entering "6" will project sales for the next six months.
  • You can also toggle the Seasonality setting if your business experiences predictable peaks and troughs (e.g., holiday sales).

Looker will automatically extend the trend line into the future, showing a shaded confidence interval around the forecast. This gives you a fast, visually intuitive sales projection.

When to Use This Method

The built-in forecast feature is great for:

  • Quick visual analysis and spotting high-level trends.
  • Stakeholders who need a simple, directional forecast without statistical complexity.
  • Stable business models where past performance is a strong indicator of future results.

However, it is a simple model (often based on exponential smoothing or linear regression). It won’t account for complex variables like upcoming marketing campaigns, changes in the market, or the impact of different sales teams.

Method 2: Building Custom Forecasts with LookML

For more control and accuracy, you can build custom forecasting logic directly into your LookML model. This is where Looker's true power lies, allowing you to define exactly how your forecast should be calculated. This approach is more robust but requires Looker development skills (or access to someone who has them).

The Concept: Using Logical Measures in LookML

Instead of relying on the visualization layer, you can create measures in LookML that calculate a forecast based on a formula you define. A common starting point is to use a historical run rate or a moving average to project future performance.

For example, you could create a measure that forecasts next month's sales by averaging the sales of the past three months.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Example: A Trivial Run-Rate LookML Measure

Let's imagine you want to create a forecasting measure based on past performance. While a fully functional LookML forecast would involve more complex logic (often leveraging derived tables), here’s a simplified concept to illustrate the idea. In your view file, you could create a measure that checks if the date is in the future and, if so, applies a calculation.

measure: total_sales_with_forecast {
  type: number
  sql:  CASE
          WHEN ${orders.created_date} > CURRENT_DATE() THEN
            -- This is a very simple example projecting last period's average
            -- In reality, you'd use a more robust calculation, often in a derived table
            (SELECT AVERAGE(total_sale_price) FROM orders WHERE ...)
          ELSE
            ${total_sale_price}
        END ,,
  value_format_name: usd
}

Note: The above code is for illustrative purposes. A production-ready LookML forecast would likely involve Persistent Derived Tables (PDTs) to pre-calculate historical stats and then apply them to future timeframes.

Advanced Option: Integrating with BigQuery ML (BQML)

If your back-end data warehouse is Google BigQuery, you can take forecasting a giant leap forward. Looker integrates seamlessly with BigQuery ML, which allows you to run machine learning models, including sophisticated time-series forecasting models like ARIMA, directly from your database.

How it works:

  1. You create and train a forecasting model in BigQuery using SQL commands (e.g., CREATE MODEL).
  2. In Looker, you create a Derived Table in your LookML project that calls this ML model using the ML.FORECAST function.
  3. Looker can then query this derived table, pulling the model's predictions and visualizing them alongside your actual data.

This is the most powerful and scalable method for forecasting in Looker. It gives you access to enterprise-grade ML models while keeping all the reporting and visualization inside an intuitive BI environment.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Method 3: The Spreadsheet Workaround (Export & Forecast)

What if you aren't a LookML developer and need something more tunable than the built-in trend line? The classic spreadsheet method is a perfectly valid and practical workaround.

This approach gives you the flexibility of spreadsheet functions like FORECAST and TREND while still using Looker as your reliable single source of truth for the initial data.

  1. Export Your Data: Build a simple Look in Looker with your historical sales data. Use two columns: a date dimension (e.g., Month) and a sales measure (e.g., Total Revenue).
  2. Download the Data: Click the menu at the top-right of your Explore and download the data as a CSV or Excel file.
  3. Use Spreadsheet Functions: Open the file in Google Sheets or Excel. Add future time periods in the date column (e.g., next 6 months). In the adjacent cell, use the FORECAST function.

In Google Sheets, the formula looks like this:

=FORECAST(A15, B2:B14, A2:A14)

  • A15 is the future month you want to predict.
  • B2:B14 is the range of your historical sales data.
  • A2:A14 is the range of your historical months.
  1. Visualize: Create a line chart in your spreadsheet to see your actuals and your new forecast together. For a truly integrated approach, you can even connect this Google Sheet back into Looker as a data source to build a report showing 'Forecast vs. Actuals'.

Best Practices for Sales Forecasting

Regardless of which method you choose, a few core principles will help make your forecasts more reliable.

  • Understand the Model: Know the limitations of your approach. The built-in Looker forecast is a simple extension of a trend. A BQML model is far more advanced. Choose a model that matches the complexity of your business.
  • Visualize Actuals vs. Forecast: Always plot your forecast on the same chart as your actual results. This builds trust and shows stakeholders exactly how your projections are tracking against reality. Use a dotted or lighter-colored line for the forecast to distinguish it.
  • Iterate and Refine: A forecast is a living document. Regularly review your performance against the forecast and use those insights to refine your models over time.
  • Add Context: Use text tiles on your Looker dashboard to add context. Did a major marketing campaign run in a certain month? Was there a change in pricing? This qualitative information is just as important as the quantitative data.

Final Thoughts

Looker offers a flexible set of tools for tackling sales forecasting, allowing you to choose a path that fits your skill level and forecasting needs. You can start with the simple, click-to-activate trend line for quick insights, use manual spreadsheet models for more control, or dive into LookML and BQML for a deeply integrated and powerful predictive solution. The key is to start with clean data and continuously measure your forecasts against what actually happens.

Of course, building and maintaining custom reports in tools like Looker is a time drain, often pulling you into a cycle of manual tweaking and endless data exports. This is exactly why we built Graphed. Instead of wrestling with complex configurations or writing code, you can connect your data sources - like Google Analytics, Shopify, and Salesforce - and an AI-powered analyst builds the real-time dashboards for you using simple, natural language. It's designed to give you instant answers about your marketing and sales performance, so you can focus on strategy instead of struggling with report setup.

Related Articles