CLOSE
CLOSE
https://www.sikich.com

How to Set Up Dynamics 365 for Operations Demand Forecasting with Azure Machine Learning

Dynamics 365 Demand Forecasting has had standard functionality for awhile. If you’re unfamiliar with it, Microsoft has an overview of its functionality on their Dynamics 365 site. However, the following diagram also illustrates it quite nicely:

Dynamics 365 demand forecasting

Azure Machine Learning is essentially a cloud-based predictive analytical solution. It replaces the SQL Server Analysis Services time series algorithm that AX 2012 uses. For D365 Demand Forecasting, we will use it to predict demand for future time periods based on historical demand. For this example, we’re using the standard demo data. Other than the parameters noted below, no other setup was required.

Dynamics 365 Setup

Our first task is to set up the Demand Forecasting parameters. Set the Forecast generation strategy on “Azure Machine Learning.

Master Planning Setup Demand Forecasting Demand Forecasting parameters

dynamics 365 demand forecasting

Once set, the following warning will pop up.

dynamics 365 demand forecasting

Click on Message Details to reveal the remaining setup steps.

dynamics 365 demand forecasting

Deploying Azure Machine Learning Studio

Now it’s time to set up the experiment in Azure Machine Learning Studio. First, Visit the Demand Forecasting experiment in the Cortana Intelligence Gallery. The Cortana Intelligence Gallery is like an app store for Machine Learning.

Click the “Open in Studio” button to continue.

dynamics 365 demand forecasting

Next, sign up for an account. The free account will work fine for this example.

dynamics 365 demand forecasting

Once your account is active, you can deploy the experiment directly from the gallery and select an Azure region for deployment. Please note that if you are deploying D365 on-premises you will also need an Azure storage account.

dynamics 365 demand forecasting

Once deployed, we can see our Demand Forecasting experiment. The Studio shows two types of inputs—manual data and data received from a web service. In this scenario, the web service is D365. Below that, an R script generates our forecast, and then the calling web service splits and returns our data.

dynamics 365 demand forecasting

Inputs

Our experiment has three different inputs.

  • Web service input – input received from Dynamics 365
  • Sample Data – data used when we run the experiment as a standalone
    dynamics 365 demand forecasting
  • Parameters – sample parameters used in conjunction with the sample data from above to run the experiment
    dynamics 365 demand forecasting

Generate Forecast

Written in R, a statistical computing and programming language, this is where the brains of the operation reside. R is in part named after the S statistical programming language on which it is based, and its creators, Ross Ihaka and Robert Gentleman from the University of Auckland.

In a gross over simplification, the script restructures and validates the data before generating the forecast based of the model we have chosen to use.

dynamics 365 demand forecasting

Split Data

The Split data step is a data transformation. We are splitting out dataset output from the R script into two groups, based on the value of the Type column. This gives us two datasets – one good and one with all errors.

dynamics 365 demand forecasting

Select and Return Datasets

Lastly, we select specific columns we want to return from the datasets and return these to the calling web service.

dynamics 365 demand forecasting

dynamics 365 demand forecasting

Deploy the Web Service

We next need to run the script. This validates it so we can deploy the web service we’ll need next.

dynamics 365 demand forecasting

dynamics 365 demand forecasting

dynamics 365 demand forecasting

Once deployed, you’ll be able to grab the API key.

dynamics 365 demand forecasting

Click on the “API help page” for the REQUEST/RESPONSE to get the web service URL.

dynamics 365 demand forecasting

For the webservice URL, include everything up to the /execute?api… section, similar to the following example:

https://ussouthcentral.services.azureml.net/workspaces/12add345678901bb2ebb345eb67f890/services/123de45bc6c789012b34567ff89e

dynamics 365 demand forecasting

Parameter Update

Finally, now we have what we need to update the Demand Forecasting parameters with our values obtained above.

dynamics 365 demand forecasting

Execution

Now that we’ve finished the setup, we can run demand forecasting from Master planning Forecasting Demand forecasting Generate statistical baseline forecast. In the parameters below, I selected to generate my forecast for the next three months.

dynamics 365 demand forecasting

And about 10 minutes later…

dynamics 365 demand forecasting

dynamics 365 demand forecasting

Now that it’s executed successfully, we can view the forecast from Master planning Forecasting Demand forecasting Adjusted demand forecast.

dynamics 365 demand forecasting

Have any questions? Don’t hesitate to contact us about setting this up for your Dynamics 365 scenario or with any other questions about the Dynamics family.

This publication contains general information only and Sikich is not, by means of this publication, rendering accounting, business, financial, investment, legal, tax, or any other professional advice or services. This publication is not a substitute for such professional advice or services, nor should you use it as a basis for any decision, action or omission that may affect you or your business. Before making any decision, taking any action or omitting an action that may affect you or your business, you should consult a qualified professional advisor. In addition, this publication may contain certain content generated by an artificial intelligence (AI) language model. You acknowledge that Sikich shall not be responsible for any loss sustained by you or any person who relies on this publication.

About the Author