How to Do Predictive Analysis in Tableau
Building a predictive model no longer requires a data science degree or a background in complex statistical programming. With tools like Tableau, you can start using your historical data to forecast future trends and make more proactive decisions. This guide will walk you through the practical steps to perform predictive analysis directly within Tableau, from simple forecasting to building your own basic models.
Understanding Predictive Analysis (Without the PhD)
In simple terms, predictive analysis is the practice of using existing data to predict future outcomes. You're not looking in a crystal ball, you're using statistical techniques and algorithms to identify the likelihood of future results based on historical patterns. Think of it as moving from asking "What happened last quarter?" to "What's likely to happen next quarter?"
Here are a few places you see it in action every day:
- E-commerce: A site like Amazon uses your past purchase history and browsing behavior to predict which products you're likely to buy next and features them in your "Recommended for you" section.
- Sales: A sales manager forecasts their team’s quarterly revenue by analyzing the current pipeline, historical win rates, and the average deal size.
- Marketing: A marketing team predicts which leads are most likely to convert into paying customers based on their engagement, job title, and company size, allowing them to focus their efforts more effectively.
The great thing is that you no longer have to build these models from scratch. Tableau has baked powerful predictive capabilities right into its interface, making it possible for analysts, marketers, and business owners to start finding these insights themselves.
Preparing Your Data for Tableau's Predictive Functions
Before you can predict anything, you need a solid foundation. The quality of your predictions is entirely dependent on the quality of your data - "garbage in, garbage out" is the core rule here. While Tableau is powerful, it can't fix fundamental data problems.
Data Quality Comes First
Ensure your dataset is clean. This means addressing missing values and looking for obvious outliers that might skew the results. For instance, if a single sale was accidentally entered as $1,000,000 instead of $10,000, it would dramatically throw off your sales forecast. You can use Tableau's data filtering features or a tool like Tableau Prep to clean your data before you begin.
Choose the Right Variables
To build a model, you need two types of variables:
- Target Expression: This is the thing you want to predict. It's your goal or outcome. For example,
[Sales],[Customer LTV], or[Conversion Rate]. - Predictor Expressions: These are the variables you believe influence your target. For example, to predict
[Sales], your predictors might be[Advertising Spend],[Website Traffic], or[Season].
The key is to select predictors that have a logical relationship with the outcome you're trying to predict. Including irrelevant data will only add noise and weaken your model.
Quick and Easy Forecasting in Tableau
The simplest way to get started with prediction in Tableau is with its built-in, one-click forecasting feature. This works best for time-series data, where you want to predict a future value based on its past performance over time. Let's see how to forecast sales for the next year.
Step 1: Create a Time-Series Line Chart
You absolutely need a date field for this to work.
- Drag your date dimension (e.g., Order Date) onto the Columns shelf. Right-click it and choose a continuous value like "Month (May 2015)."
- Drag the measure you want to forecast (e.g., Sales) onto the Rows shelf.
You should now see a line chart showing your sales trend over time.
Step 2: Drag and Drop the Forecast
- Go to the Analytics pane on the left side menu (next to the Data pane).
- Under the "Model" section, find Forecast.
- Simply drag Forecast and drop it onto your chart. You'll see an overlay option called "Forecast."
And that's it! Tableau will automatically extend your timeline into the future, showing a forecast of your sales. It also includes a shaded area representing the 95% prediction interval - a confidence range where the actual values are likely to fall.
Step 3: Customize Your Forecast Options
You have more control than just the default setting. Right-click anywhere in the forecasted area of your chart and select Forecast > Forecast Options...
Here you can tweak several settings:
- Forecast Length: Change "Automatic" to "Exactly" to define a specific period, like the next 6 months or 2 years.
- Source Data: You can tell Tableau to ignore the last few months of data, which is useful if you want to see how well the model would have predicted the recent past.
- Forecast Model: You can stick with "Automatic" or manually set the trend and season to "Additive" or "Multiplicative" if you have a deeper understanding of your data patterns. For most users, "Automatic" works just fine.
Building Predictive Models with Table Calculation Functions
For predictions that go beyond simple time-series forecasting, you can use Tableau's predictive modeling functions: MODEL_QUANTILE and MODEL_PERCENTILE. These functions let you build a regression model to predict a value based on one or more predictors.
Let's walk through an example of predicting a student's final exam score based on the number of hours they studied and their scores on previous quizzes.
The basic syntax looks like this:
MODEL_QUANTILE(quantile, [target_expression], [predictor_expression_1], [predictor_expression_2], ...)Step 1: Build Your Base Visualization
Create a scatter plot to see the relationship between your variables.
- Place your first predictor (e.g., Hours Studied) on the Columns shelf.
- Place your target (e.g., Final Exam Score) on the Rows shelf.
- To see individual data points, drag a dimension like Student ID onto the Detail card in the Marks pane.
This shows you the relationship between study hours and exam scores for each student. Now let's build the model.
Step 2: Create the Calculated Field for the Prediction
- Go to Analysis > Create Calculated Field...
- Name it something clear, like "Predicted Score."
- Enter the following formula:
MODEL_QUANTILE(0.5, ZN(AVG([Final Exam Score])), ZN(AVG([Hours Studied])), ZN(AVG([Quiz Score])))Breakdown:
0.5tells the model to predict the median value, which is generally a good, robust starting point.ZN(AVG([Final Exam Score]))is our target — the average exam score we want to predict. TheZN()function handles NULLs by treating them as zero.ZN(AVG([Hours Studied]))andZN(AVG([Quiz Score]))are the predictors. The model uses both to predict the final score.
Step 3: Visualize the Prediction
- Drag your new calculated field, Predicted Score, from the Data pane and drop it onto the Rows shelf next to your Final Exam Score measure.
- Right-click the Predicted Score pill on the Rows shelf and select Dual Axis.
- Right-click the second vertical axis on your chart and select Synchronize Axis to make sure both measures are using the same scale.
You will now see a second set of marks overlaid on your scatter plot, representing the model's prediction for each student. This allows you to quickly see which students performed above or below the predicted score based on their study habits and quiz performance.
Tips for Using Your Predictions Wisely
Building a predictive model is just the first step. Interpreting and using the results responsibly is what really drives value.
Predictions are Probabilities, Not Certainties
A forecast is an educated guess based on patterns, not a guarantee. The confidence intervals Tableau shows are crucial - they give you a realistic range of possible outcomes. Always plan for the range, not just the single predicted value.
Start Simple
It can be tempting to throw every variable you have into a model, hoping to make it more accurate. This often does the opposite by introducing noise. Start with one or two predictors that you believe have the strongest influence on the outcome and build from there.
Validate Your Model
Before you trust its predictions, check how well your model performs on data it hasn't seen before. A common technique is to build the model using data from last year and see how well it would have predicted this year's results.
Combine Data with Domain Knowledge
Your model doesn't understand the real-world context of your business. If your forecast predicts a huge jump in sales but you know your main factory will be shut down for maintenance next month, you need to use your own knowledge to adjust expectations. Always treat predictive models as a tool to support your decision-making, not replace it.
Final Thoughts
By leveraging its built-in analytics, Tableau gives you the tools to move beyond historical reporting and start forecasting what comes next. Whether you use the simple drag-and-drop forecast or build custom regression models with calculation functions, you can empower your team to make more data-driven, forward-looking decisions without needing a dedicated data scientist.
While tools like Tableau are incredibly powerful, we know that setting up data sources and mastering calculated fields still presents a learning curve. That’s why we built Graphed - to remove that friction entirely. You can connect your marketing and sales platforms in a few clicks, then simply ask for a forecast in plain English, like “Forecast our web traffic from Google for the next 30 days,” and get a real-time answer in seconds. No formulas, table calculations, or configurations necessary.
Related Articles
How to Enable Data Analysis in Excel
Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.