How to Use What-If Analysis in Looker with AI

Cody Schneider

Thinking about the future of your business shouldn't feel like guessing. What-if analysis opens up a powerful way to forecast outcomes by modeling different scenarios, like seeing how a 15% budget cut might impact your lead generation. This article will show you how to perform what-if analysis in Looker, using AI to simplify the process and uncover deeper insights.

What is What-If Analysis, Anyway?

At its core, what-if analysis (or scenario planning) is a method for predicting outcomes by changing variables in a model. Instead of just looking at historical data to see what happened, you proactively explore what could happen. It turns your data from a rearview mirror into a GPS for future decisions.

Some common what-if questions for marketing and sales teams include:

  • "What if we increase our social media ad spend by 20%? How would that affect our cost per acquisition (CPA)?"

  • "What if our website conversion rate improves by just 0.5%? What would be the impact on our total monthly revenue?"

  • "What if we hire two more salespeople? How many more deals could our team close per quarter, assuming our current close rate?"

Working this out in a spreadsheet can be a manual, error-prone process. Doing it directly inside your BI tool, where your data is live and centralized, is far more powerful. Looker can handle this, but it traditionally requires some technical setup. That's where AI can step in to act as your smart assistant.

The Traditional Way: What-If Analysis in Looker

Setting up what-if analysis in Looker typically involves creating user-controlled inputs, known as parameters. These parameters allow you to create dynamic variables in your dashboards that anyone can adjust without needing to write code. Users can drag a slider or type in a number, and the charts update instantly to reflect the new scenario.

The process generally looks like this:

  1. Define Parameters in LookML: A developer has to go into Looker's modeling layer (LookML) to define the inputs. For example, they might create a parameter called ad_spend_increase that allows a user to input a percentage.

  2. Write Logic to Apply Parameters: The developer then writes LookML or SQL logic to apply this parameter to your existing data. This might involve creating a new "forecasted revenue" measure that multiplies current revenue by the ad_spend_increase parameter.

  3. Build an Explore or Dashboard: Finally, you build a visualization that compares your actual data to your new, parameter-driven "what-if" data.

As you can see, this is powerful but also developer-dependent. Getting new scenarios modeled can be slow if it involves getting in a queue for your data team. Now, let’s see how AI can help you bypass some of these hurdles.

Using AI as Your Looker Co-Pilot for Scenario Planning

Instead of viewing AI as a replacement for Looker, think of it as a powerful assistant that helps at every stage of the what-if process. Here's a practical workflow for combining AI with Looker to make forecasting more accessible, even if you’re not a LookML expert.

Step 1: Brainstorm Scenarios and Identify Key Variables with AI

Before you even open Looker, your biggest challenge is often knowing what scenarios to model. Which variables have the biggest impact on your goals? Guessing can waste a lot of time.

Instead, let an AI give you a starting point. Export a relevant dataset from Looker (like campaign performance data from the last 90 days) as a CSV file. Then, you can use a tool like ChatGPT or Claude to analyze it.

For example, you could prompt it with:

"I've uploaded a CSV of our marketing campaign data with columns for spend, clicks, conversions, and revenue. Analyze this data and identify the top 3 metrics that have the strongest correlation with revenue. We want to build a what-if model to drive revenue growth."

The AI might come back and tell you that "clicks per campaign" and "conversion rate" are the most influential drivers. This is hugely valuable. Now you know exactly which variables to focus on for your what-if analysis in Looker, avoiding less impactful metrics.

Step 2: Get AI Assistance for Generating Looker Parameters

The most technical part of an interactive what-if dashboard is writing the LookML code for the parameters. This used to be a firm roadblock for non-developers. Today, AI can write that code for you.

Let's say you want to create a parameter that lets a user model a change in the website conversion rate, from -50% to +50%. You can ask an AI code assistant:

"Write the LookML for a parameter named 'Conversion Rate Change'. It should be a number, presented as a slider, that goes from -0.5 to 0.5 in increments of 0.05. The default value should be 0."

The AI will likely generate something like this, which you or a teammate can then paste into the appropriate LookML view file:

Even if you don't know LookML, having the AI generate a high-quality starting point makes collaborating with your data team much faster. It transforms your request from a vague idea into a concrete code suggestion.

Step 3: Create 'What-If' Metrics Using Table Calculations

Once your parameter is in Looker, you need to apply it to your metrics. While this can be done in LookML, Looker's Table Calculations offer a more user-friendly way to do this right from an Explore, no developer time needed.

Let’s continue with our "conversion rate change" example. Imagine you have a table with your original Orders and your website Sessions.

  1. In your Explore, create a calculation for your baseline Conversion Rate: ${orders.count} / ${sessions.count}. Let's name it 'Actual CR'.

  2. Now, create a new table calculation to model the what-if scenario. Name it 'Forecasted CR'. The formula would use your parameter: ${actual_cr} * (1 + @{conversion_rate_change}).

  3. Finally, create a 'Forecasted Revenue' metric by multiplying your forecasted orders by your average order value (AOV): (${sessions.count} * ${forecasted_cr}) * ${your_aov_measure}.

The magic here is that @{conversion_rate_change} will dynamically pull the value from the slider or input field you added to your Dashboard. When a user drags the "Conversion Rate Change" slider to +10%, all the 'Forecasted' metrics will update in real-time.

Step 4: Visualize Your Scenarios and Get AI Storytelling

Now you can build a dashboard in Looker to visualize everything. The most effective approach is a side-by-side comparison.

  • Create a scorecard visualization for 'Actual Revenue' and another one for 'Forecasted Revenue'.

  • Build a line chart that shows historical revenue and then a second-line series showing forecasted revenue based on your what-if variable.

  • Don't forget to add the 'Conversion Rate Change' parameter filter we created to your Dashboard so users can interact with everything.

Once you have your dashboard, AI can help with the final - and most important - step: interpretation. Take a screenshot of your what-if scenario (e.g., the result of a 10% conversion rate increase) and ask an external language model for help with the narrative.

You can prompt it with:

"Here is a dashboard showing a what-if scenario. On the left are our actual numbers for last month's revenue and conversions. On the right are the forecasted numbers assuming a 10% increase in our web conversion rate. Summarize the business impact shown in this dashboard in a few sentences for a non-technical executive."

The AI can help generate a clear summary like, "Our analysis shows that a modest 10% improvement to our web conversion rate would directly result in an estimated $52,000 in additional monthly revenue. This suggests that projects focused on conversion rate optimization could deliver highly valuable, near-term ROI." This turns raw numbers into a persuasive business case.

Final Thoughts

What-if analysis is how you move from simply reporting on the past to strategically planning for the future. By using Looker’s built-in parameters and leaning on AI as a co-pilot — for brainstorming, code generation, and interpretation — you can make this powerful technique much more accessible for your entire team and make smarter, data-informed decisions faster.

While this workflow makes the process in Looker much easier, it is still a multi-step, technical process. We built Graphed because we believe asking these kinds of forward-looking questions shouldn't require knowing LookML or juggling different tools. You simply connect all of your sources — like Shopify, Salesforce, and Google Analytics — in one-click, then you use plain language to build these forecasts instantly. Instead of a day of setup, you can just ask, "What would our revenue for next quarter look like if we spend an extra $1,000 a month?" and watch it get built for you in seconds.