Tableau Funtion: MODEL_PERCENTILE( )

Tableau Function: MODEL_PERCENTILE( )

Category: Table Calculation Functions

Purpose

The MODEL_PERCENTILE() function in Tableau is a predictive modeling function used to calculate a specified percentile of predicted values based on a statistical model fitted to the data. It is commonly used to understand distribution thresholds, risk levels, or expected bounds of future or modeled outcomes.

In simple terms, MODEL_PERCENTILE() answers:
“At a given percentile, what value does the model predict?”

Type of Calculations

  • Predictive analytics

  • Statistical modeling

  • Distribution-based percentile estimation

  • Model-driven calculations

This function relies on built-in statistical models rather than raw aggregations or table calculations.

Practical Use Cases

  • Identifying upper or lower bounds of expected outcomes

  • Risk analysis (e.g., worst-case or best-case scenarios)

  • Forecast threshold analysis

  • Outlier detection and anomaly thresholds

  • Confidence-based decision making


MODEL_PERCENTILE(expression, percentile)

ParameterTypeDescription
expressionMeasure (column)The numeric measure used to build the predictive model. Must be continuous.
percentileScalar (decimal)A value between 0 and 1 representing the desired percentile (e.g., 0.95 for the 95th percentile).

How It Works?

Mathematical / Logical Principle

MODEL_PERCENTILE() fits a statistical distribution model to the input data and then computes the value at the requested percentile of that modeled distribution.

Conceptually:

MODEL_PERCENTILE(X, p) = value such that P(X ≤ value) = p

Where:

  • X is the modeled measure

  • p is the percentile (0–1)

The function does not simply calculate a raw percentile—it uses a modeled distribution, which smooths variability and supports forecasting.

What Does It Return?

  • Data Type: Numeric (same as the expression)

  • Meaning:

    • Returns the predicted value at the specified percentile based on the fitted model

    • Returns NULL if insufficient data exists to build the model

When Should We Use It?

Use MODEL_PERCENTILE() when you need to:

  • Estimate threshold values from predictive models

  • Analyze risk using percentile-based boundaries

  • Understand distribution behavior of modeled outcomes

  • Support forecasting and what-if analysis

  • Replace raw percentile calculations with modeled estimates

Basic Usage

Calculate the median modeled value


MODEL_PERCENTILE(SUM([Sales]), 0.5)

Returns the modeled median of Sales

Column Usage

Upper-bound analysis


MODEL_PERCENTILE(AVG([Profit]), 0.9)

  • Estimates the 90th percentile profit based on the model
  • Useful for optimistic forecasting scenarios

Advanced Usage

Compare actual values to modeled threshold


IF SUM([Sales]) > MODEL_PERCENTILE(SUM([Sales]), 0.95)
THEN "Above Expected Range"
ELSE "Within Expected Range"
END

Flags unusually high values relative to the model

Dynamic percentile parameter


MODEL_PERCENTILE(SUM([Sales]), [Selected Percentile])

Allows users to control percentile via a parameter

Tips and Tricks

  • Use percentiles between 0 and 1 only

  • Ensure sufficient historical data for reliable models

  • Combine with parameters for interactive analysis

  • Results depend on the quality and distribution of input data

  • Not a replacement for raw percentile functions like PERCENTILE()

Related Functions You Might Need

Functions commonly used alongside or as alternatives to MODEL_PERCENTILE():

  • MODEL_QUANTILE()

  • MODEL_AVERAGE()

  • MODEL_MEDIAN()

  • MODEL_MAX()

  • MODEL_MIN()

  • PERCENTILE()

We’ve got plenty of resources to help you master Tableau functions. For more details, check out the official Tableau documentation. Or, if you’re ready for more practice, let’s dive into related functions and build your Tableau skills further!

If you’re ready to harness the full power of Tableau and elevate your data analytics capabilities, our expert Tableau consulting services are here to guide you. Whether you need support with building advanced calculated fields, creating dynamic visual dashboards, or optimizing your data sources for peak performance, our team of experienced Tableau consultants delivers customized solutions designed for your business needs. Visit our Tableau Consulting page to discover how we can help your organization turn data into impactful, insight-driven decisions.

1. What does MODEL_PERCENTILE() do in Tableau?

It returns a predicted value at a specified percentile based on a statistical model.

2. How is MODEL_PERCENTILE() different from PERCENTILE()?

MODEL_PERCENTILE() uses a predictive model, while PERCENTILE() calculates directly from raw data.

3. What range should the percentile value be?

The percentile must be between 0 and 1.

4. Does MODEL_PERCENTILE() require historical data?

Yes, sufficient data is required to build a reliable model.

5. Is MODEL_PERCENTILE() suitable for forecasting?

Yes, it is commonly used for forecast thresholds and risk analysis.