1. Forecasting in Power BI
Hi there! In this session, we will go over the basics of forecasting in Power BI.
2. Context and importance
Forecasting is an important topic and one that the data analytics industry has been moving toward for a long time. Data provides a great deal of insight, but mostly for events that have already happened. To be more proactive, we want to use that data to model what will happen. Forecasting is one such method for that and can be incredibly beneficial.
In this data visualization, we can see a dataset with significant variation. By using forecasting methods, we can try to make sense of the overall trends in the data, and predict future events to help drive decisions.
3. Forecasting types
While forecasting is typically what people will call these predictive analytics, there are a couple of different kinds of predictions we can make.
Forecasting is when we take our existing data and project into the future, and it is the most common approach. This allows us to predict what will happen in the future. Examples of this in the industry include forecasting sales demand for a product or company or predicting how many engineers you will need to hire to continue developing your product.
Hindcasting is more of a niche group of predictive analytics. With hindcasting, we take our existing data and project it forward in time to validate the data. Usually, this is done to validate an existing model, such as testing the variables in an environmental model, or verifying data against the latest stock data.
4. Forecasting fundamentals
Let's discuss the fundamentals of how a forecast works. At a high level, a forecast is a model that uses historical data to try and predict the future. The model will look at the different trends that show up in the data.
Here, we have a small data table with values for the first three days of January. We can see that we are missing the next two values, which means that we would like to forecast those values.
We can see that the data seems to be increasing by five each day, so we can reliably assume that the data in the future will follow the same pattern. This kind of forecasting is an example of linear regression, which is usually the first place we start with forecasting.
5. Forecasting messy data
We know that data can be pretty messy, which poses a problem for forecasting methods when you want an accurate result. A common technique to address this is exponential smoothing, which essentially will take any noise in the data and convert it to a smooth continuum. We won't get into the math behind exponential smoothing, but we wanted to call out that Power BI automatically uses this technique when using its built-in forecasting capabilities.
Here is a GIF that effectively demonstrates what exponential smoothing is doing. There is a noisy dataset that, after exponential smoothing, looks like a smooth curve and is much easier to forecast from.
6. Confidence in forecasts
Inherently, all forecasts will have some level of error in them. And that's OK! To make any kind of decision from these forecasts, we need to have some kind of confidence.
In statistics, this is a Confidence Interval, which is effectively a range of values that the data will likely fall in. In Power BI, you can configure the level of confidence you want in your forecast.
In this GIF, we can see that with our forecast, the 95% confidence interval has a wider range. As we narrow the forecast funnel, our confidence level drops lower and lower, meaning we can't be as sure the data will have that value.
7. Stock dataset
For the exercises in this chapter, we will be looking at some stock data for Microsoft, which seems fitting given we are using Power BI. This dataset includes some basic information about how the stock's value performed on each day, such as the low and high prices, as well as where the stock closed. This will provide a good dataset for these kinds of forecasting analyses.
8. Let's practice!
Now, let's jump into some financial data and practice some forecasting!