Sometime we need a data forecasting in Power BI but It seems it is not easy to implement forecasting feature using Python code due to a public network. In the case, using dax is an alternative option
There are several forecasting model in time series data in data science field
- Linear regression is a relatively simple forecasting model as you can do it in excel spread sheet, which can predict a value by using another value . Mathematically, the formula can describe as below:
Y = a + bX, where X is the explanatory variable and Y is the dependent variable.
It may work as long as you have a large dataset such as at least 20 or 30 time periods. - In neural network, there is no assumed relationship between the independent and dependent variables. Neural Networks are ideal for large datasets and non-linear problems.
In Power BI, it may work with Azure ML environments with either private end point or public as a web service. In Power query mode, python only works with public networks
LINEST and LINESTX are DAX functions that calculate linear regression in time series data. Lets have a look at input parameters and output results
Syntax
LINESTX (<Table>, <ExpresssionY>, <ExpressionX> )
Where <Table> is a collection of multiple columns to evaluate ,
<ExpressionY> is a row of the table for y-values such as revenue,
<ExpressionX> is a row of the table for x-values such as date