Tableau Funtion: MODEL_QUANTILE( )
Tableau Function: MODEL_QUANTILE( )
Category: Table Calculation Functions
Purpose
The MODEL_QUANTILE() function in Tableau is a predictive analytics function that returns the predicted value at a specified quantile based on a statistical model fitted to the data. It is used to understand distribution cut points (such as quartiles, deciles, or other quantiles) derived from modeled behavior rather than raw data.
In simple terms, MODEL_QUANTILE() answers:
“According to the model, what value corresponds to this quantile?”
Type of Calculations
Predictive modeling calculations
Statistical distribution analysis
Quantile estimation from a fitted model
Model-based threshold calculations
Unlike standard percentile or quantile functions, MODEL_QUANTILE() relies on modeled distributions, not direct aggregation of observed values.
Practical Use Cases
Identifying modeled quartiles or deciles
Risk and probability threshold analysis
Understanding distribution spread in forecasts
Scenario planning and predictive benchmarking
Defining statistically informed cutoffs for KPIs
MODEL_QUANTILE(expression, quantile)
| Parameter | Type | Description |
|---|---|---|
| expression | Measure (column) | The continuous numeric measure used to build the predictive model. Must be aggregated in the view. |
| quantile | Scalar (decimal) | A value between 0 and 1 indicating the desired quantile (e.g., 0.25, 0.5, 0.75). |
How It Works?
Mathematical / Logical Principle
MODEL_QUANTILE() fits a statistical model to the input measure and then computes the value at the requested quantile of that modeled distribution.
Conceptually:
MODEL_QUANTILE(X, q) = value such that P(X ≤ value) = q
Where:
Xis the modeled measureqis the quantile (0–1)
This approach smooths variability and supports more stable estimates compared to raw quantile calculations.
What Does It Return?
Data Type: Numeric (same data type as the expression)
Meaning:
Returns the predicted value at the specified quantile of the modeled distribution
Returns
NULLif the model cannot be computed due to insufficient or invalid data
When Should We Use It?
Use MODEL_QUANTILE() when you need to:
Analyze distribution cut points using predictive models
Replace raw quantiles with statistically smoothed estimates
Understand forecasted data ranges
Perform probability-based segmentation
Support advanced analytics and decision modeling
Basic Usage
Calculate the modeled median
MODEL_QUANTILE(SUM([Sales]), 0.5)
Returns the modeled median value
Column Usage
Calculate the first and third quartiles
MODEL_QUANTILE(AVG([Profit]), 0.25)
MODEL_QUANTILE(AVG([Profit]), 0.75)
Useful for modeled IQR (interquartile range) analysis
Advanced Usage
Flag values above the modeled upper quartile
IF SUM([Sales]) > MODEL_QUANTILE(SUM([Sales]), 0.75)
THEN "Above Typical Range"
ELSE "Within Typical Range"
END
Identifies values exceeding expected distribution levels
Parameter-driven quantile selection
MODEL_QUANTILE(SUM([Sales]), [Selected Quantile])
Enables interactive analytics using user-defined quantiles
Tips and Tricks
Use quantile values strictly between
0and1Ensure enough historical data for reliable modeling
Combine with parameters for exploratory analysis
Results depend on the underlying data distribution
Not equivalent to raw
PERCENTILE()orQUANTILE()functions
Related Functions You Might Need
Functions commonly used alongside or as alternatives to MODEL_QUANTILE():
MODEL_PERCENTILE()MODEL_MEDIAN()MODEL_AVERAGE()MODEL_MAX()MODEL_MIN()PERCENTILE()QUANTILE()
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.
It returns a predicted value at a specified quantile based on a statistical model.
MODEL_QUANTILE() uses a predictive model, while QUANTILE() calculates directly from observed data.
Any decimal value between 0 and 1.
Larger datasets typically produce more reliable models, but it can work with smaller sets.
Yes, it is often used to analyze forecast distributions and probability thresholds.