When it comes to using Azure ML model predictions in Power BI reports, the first thing to do is ensure that the right edition of Power BI is being used. With Power BI Premium or with Power BI Embedded, access to advanced features is provided through integration with Azure AI features like Azure Machine Learning. Power BI Pro may allow for some simple integrations; however, sophisticated options such as enriching content using AI or Azure ML Visual cannot be done using Power BI Pro, only Power BI Premium or Power BI Embedded.
How to use the prediction service of Azure ML and integrate it into a report:
Deploy Your Azure ML Model
The first step is to create a predictive model and publish it on Azure ML. Make sure that the model implementation has been published as a web service endpoint (with a REST API). The endpoint should take inputs (which are the data that needs to be predicted) and return outputs (which are the predictions) in the form of JSON. You can also test the endpoint right inside the Azure ML Studio to check if it behaves as expected.
Open Azure ML model in Power BI Desktop
In Power BI Desktop, access the Azure ML integration.
You can do this by including the azure ml model in your report as follows:
Select “Home” > “Edit Queries” > “AI Insights.”
Browse to your Azure ML workspace and select your deployed model. Note if you will need to use AAD credentials in order to authenticate for this action.
Invoke the Model
Once the connection is established, Connect the Azure ML model to apply to the existing dataset in Power BI by linking the Input columns in Power BI with respect to the Model input expecting columns. The Output (predictions) will be associated with a new column or set of columns within the Existing dataset.
Updating Data and Scalability
Make sure that your Power BI service can perform data refreshes when the Azure ML model is called. A data gateway is needed for on-premises sources, and your Azure ML endpoint has to be able to score in real time if predictions need to change. For large datasets, ensure batch scoring is deployed for scalability and process the data within Azure ML prior to importing it back into Power BI.
Best Practices:
Always undertake the Power Query process to eliminate unnecessary records before passing them on to Azure ML for further predictions.
Enhance performance when building a model, especially in Azure ML, so that the API is not too sluggish, which affects how fast the Power BI reports load.
Authenticate the Azure ML endpoint appropriately with access control tools such as Managed Identity.
This provides a good strategy for integration without choosing either one at the expense of the other in terms of data refresh and scalability in Power BI.