How can I perform simple linear regression in Power BI? 2

How to Perform Simple Linear Regression in Power BI: A Step-by-Step Guide

Perform Simple Linear Regression in Power BI

Simple linear regression is a fundamental statistical technique employed extensively in data analysis. Its primary purpose is to quantify and model the relationship between two continuous quantitative variables. In this model, one variable is designated as the dependent variable (the response), while the other is the independent variable (the predictor). This method enables analysts to understand how changes in the independent variable influence the dependent variable.

The core utility of regression lies in its predictive capability. By establishing a linear relationship, we can create a mathematical model that predicts the expected value of the dependent variable based on specific inputs of the independent variable. This makes it an invaluable tool for forecasting, risk assessment, and guiding strategic decision-making in various business contexts.

While specialized statistical software is often used for advanced modeling, powerful business intelligence platforms like Power BI offer robust capabilities for performing these complex calculations directly within the data visualization environment. Fitting a precise, formula-driven model requires leveraging Data Analysis Expressions (DAX) functions, such as LINEST, to generate the mathematical parameters necessary for a rigorous linear regression model.


Understanding Linear Regression within Power BI

As mentioned, simple linear regression provides a formal mathematical structure to quantify the relationship between a single predictor variable and a single response variable. Implementing this in Power BI requires leveraging the powerful features of its internal data engine and the DAX language. The following detailed, step-by-step guide demonstrates how to load data, fit the model using LINEST, interpret the resulting coefficients, and finally, create interactive visualizations for making real-time predictions based on the statistical findings.

Step 1: Preparing and Loading the Data

The initial step in any analytical process is ensuring the data is correctly loaded and structured within the Power BI environment. For this comprehensive example, we will utilize a dataset named my_data. This table contains crucial operational metrics related to retail performance: specifically, the total amount spent on advertising (Ad Spend) and the subsequent total revenue generated (Revenue) across a sample of retail outlets.

This sample dataset will serve as the foundation for our linear regression analysis, where we aim to determine the precise statistical impact of Ad Spend (our predictor) on Revenue (our response). Reviewing the loaded table structure confirms that our quantitative variables are correctly formatted and ready for formal statistical modeling:

Step 2: Fitting the Simple Linear Regression Model using DAX

With the data successfully loaded, the next critical step is to formally construct the linear regression model. Our objective is to define the relationship where Revenue is predicted based on the value of Ad Spend. Mathematically, the fitted relationship will adhere to the standard linear equation form, where β0 represents the intercept and β1 represents the slope:

Response = β0 + β1*(Ad Spend)

In Power BI, we accomplish this by creating a new calculated table utilizing the powerful DAX function LINEST. To initiate this process, navigate to the Table tools tab in the ribbon menu and select the New table icon.

In the formula bar that appears, input the following specific LINEST expression. This function takes the response column (Revenue) as the first argument and the predictor column (Ad Spend) as the second:

Model = LINEST(
	'my_data'[Revenue],
	'my_data'[Ad Spend]
)

Executing this formula successfully fits the simple linear regression model to the underlying data and generates a new table named Model. This table contains a comprehensive summary of the regression statistics, crucially including the slope and the intercept, which are the coefficients that define the linear relationship found between the two variables:

Interpreting the Regression Output

The resulting Model table provides the necessary coefficients to formulate the fitted regression equation rigorously. The two most critical values in the output for a simple regression are Slope1 and Intercept. These coefficients allow us to write the precise equation that estimates revenue based on ad spend:

Revenue = 8.67444 + 1.10958*(Ad Spend)

We can derive significant business insights directly from these numerical parameters and the underlying statistical meaning:

  • The Intercept0 = 8.67444) signifies the predicted baseline revenue when Ad Spend is exactly zero dollars. Based on our model, a store with no advertising spending is predicted to generate $8.67444 in revenue.
  • The Slope1 = 1.10958) quantifies the marginal effect of the predictor. It indicates that for every additional dollar a store allocates to advertising, their predicted revenue increases by an average of $1.10958, holding all other potential variables constant.

Step 3: Visualizing the Relationship and Making Predictions

While the mathematical equation provides the numerical structure of the relationship, visualization is essential for confirming the model’s fit and effectively communicating the results to stakeholders. We begin by inserting a scatter chart into the Report view. Configure this visualization by assigning Ad Spend to the X-axis (predictor) and Revenue to the Y-axis (response).

To visually represent our fitted linear regression model, we must add a trendline to the scatter plot. This line directly corresponds to the calculated regression equation, allowing us to see how closely the actual data points align with the predicted linear path:

To transform this static visualization into a dynamic, predictive tool, we will next introduce a parameter-based slicer. This interactive element will allow users to dynamically change the input value for Ad Spend and instantly observe the corresponding predicted Revenue output, calculated in real-time by referencing our derived regression equation.

Creating the Interactive Prediction Parameter

The first step in building the interactive input slider is defining a numeric range parameter. Navigate to the Modeling tab in the Power BI ribbon and select the New parameter icon, choosing the Numeric range option from the resulting dropdown menu.

In the configuration window that appears, we must name the parameter Ad Spend. We will establish the predictive range by setting the Minimum value to 0 and the Maximum value to 20, ensuring the range covers typical input scenarios for our data. It is essential to check the box labeled Add slicer to this page before confirming by clicking OK. This action automatically generates the interactive slicer visualization on the current report page.

The newly created slicer provides the dynamic input mechanism, allowing users to select any value between 0 and 20. This slider is automatically associated with a generated table containing the selected input value, which we will reference in the subsequent step to calculate the predicted revenue based on the model.

Calculating Predicted Revenue with a DAX Measure

To successfully link the interactive slider value with our regression coefficients, we must define a new measure that executes the regression formula. Switch back to the Data or Table view, go to the Table tools tab, and click New measure.

The following DAX formula implements the fitted regression equation. It retrieves the Intercept and Slope values from the previously created Model table and multiplies the Slope by the current value selected by the user in the Ad Spend slicer:

Predicted Revenue = SELECTCOLUMNS('Model', [Intercept]) + SELECTCOLUMNS('Model', [Slope1])*'Ad Spend'[Ad Spend Value]

This new measure, named Predicted Revenue, dynamically calculates the expected revenue based on the input variable defined by the slider. It successfully translates the static statistical model coefficients into a functional, dynamic forecasting tool within Power BI, ready for display.

Displaying Real-Time Predictions

The final step in the process is to display the calculated result in a clear, highly visible format on the report page. Return to the Report view and insert a standard Card visualization. Assign the newly created measure, Predicted Revenue, as the field for this card visualization.

Power BI simple linear regression

The Card now serves as a real-time output display for the prediction. For example, if the user adjusts the Ad Spend slider to precisely 10, the card instantly updates, showing the Predicted Revenue of 19.77.

We can verify that this prediction is accurate by performing a manual calculation using the fitted regression equation we found earlier:

  • Revenue = 8.67444 + 1.10958*(Ad Spend)
  • Revenue = 8.67444 + 1.10958*(10)
  • Revenue = 19.77

Users are encouraged to interact with the slider bar, observing how changes in the Ad Spend input directly and immediately affect the resulting Predicted Revenue output, thereby demonstrating the practical predictive power of the fitted simple linear regression model.

Conclusion and Further Power BI Tasks

By leveraging the LINEST function in DAX, analysts can move beyond simple visual trends to build robust, quantitative simple linear regression models directly within the Power BI platform. This capability is essential for creating powerful predictive reports and driving data-informed strategic decisions across the organization.

If you are interested in exploring other advanced analytical and data manipulation techniques within the platform, the following resources provide guidance on performing additional common tasks and statistical procedures in Power BI:

Cite this article

stats writer (2026). How to Perform Simple Linear Regression in Power BI: A Step-by-Step Guide. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-perform-simple-linear-regression-in-power-bi/

stats writer. "How to Perform Simple Linear Regression in Power BI: A Step-by-Step Guide." PSYCHOLOGICAL SCALES, 26 Jan. 2026, https://scales.arabpsychology.com/stats/how-can-i-perform-simple-linear-regression-in-power-bi/.

stats writer. "How to Perform Simple Linear Regression in Power BI: A Step-by-Step Guide." PSYCHOLOGICAL SCALES, 2026. https://scales.arabpsychology.com/stats/how-can-i-perform-simple-linear-regression-in-power-bi/.

stats writer (2026) 'How to Perform Simple Linear Regression in Power BI: A Step-by-Step Guide', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-perform-simple-linear-regression-in-power-bi/.

[1] stats writer, "How to Perform Simple Linear Regression in Power BI: A Step-by-Step Guide," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, January, 2026.

stats writer. How to Perform Simple Linear Regression in Power BI: A Step-by-Step Guide. PSYCHOLOGICAL SCALES. 2026;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top