Visualizing Churn Predictions with Power BI and Azure ML Insights
Explore how Todd Bernson, CTO, demonstrates integrating Azure Machine Learning with Power BI to visualize customer churn predictions. Learn to export predictions to Azure SQL Database, connect Power BI to Azure ML outputs, and create interactive dashboards to drive actionable insights.

Todd Bernson
2025-01-15

Effective visualization of machine learning predictions is key to making data-driven decisions. Power BI, integrated with Azure Machine Learning (Azure ML) insights, provides an interactive and accessible way to visualize churn predictions and extract actionable insights. This article demonstrates how to:
- Export predictions from Azure ML to Azure SQL Database.
- Connect Power BI to Azure ML outputs.
- Create an interactive dashboard to visualize churn metrics and customer insights.
Step 1: Exporting Predictions from Azure ML to Azure SQL Database
The first step is to export churn predictions from Azure ML to Azure SQL Database, where Power BI can access the data.
Configure Azure SQL Database with Terraform
Here’s a Terraform configuration to set up an Azure SQL Database:
resource "azurerm_sql_server" "sql_server" {
name = "ml-churn-sql-server"
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
version = "12.0"
administrator_login = "adminuser"
administrator_login_password = "P@ssword01!"
tags = var.tags
}
resource "azurerm_sql_database" "churn_db" {
name = "churn_predictions_db"
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
server_name = azurerm_sql_server.sql_server.name
requested_service_objective_name = "S0"
tags = var.tags
}
Export Predictions from Azure ML
Use the Azure ML SDK to write model predictions to Azure SQL Database:
from azureml.core import Workspace, Dataset
import pyodbc
# Connect to Azure ML Workspace
ws = Workspace.from_config()
# Load predictions from the experiment
dataset = Dataset.get_by_name(ws, "churn_predictions")
predictions_df = dataset.to_pandas_dataframe()
# Connect to Azure SQL Database
conn = pyodbc.connect(
"DRIVER={ODBC Driver 17 for SQL Server};"
"SERVER=ml-churn-sql-server.database.windows.net;"
"DATABASE=churn_predictions_db;"
"UID=adminuser;"
"PWD=P@ssword01!"
)
# Write predictions to SQL
cursor = conn.cursor()
for index, row in predictions_df.iterrows():
cursor.execute("""
INSERT INTO churn_predictions (customer_id, churn_probability, predicted_class)
VALUES (?, ?, ?)
""", row["customer_id"], row["churn_probability"], row["predicted_class"])
conn.commit()
cursor.close()
conn.close()
Step 2: Connecting Power BI to Azure ML Outputs
- Open Power BI Desktop.
- Go to Home > Get Data > SQL Server.
- Enter your Azure SQL Server name and database credentials:
- Server:
ml-churn-sql-server.database.windows.net - Database:
churn_predictions_db - Authentication Method: SQL Server Authentication.
- Server:
- Select the
churn_predictionstable and load the data.
Step 3: Designing a Dashboard with Churn Metrics and Customer Insights
With the churn predictions data loaded into Power BI, you can design an interactive dashboard.
Metrics to Include:
- Churn Probability: Average churn probability by customer segment.
- Predicted Churn Rate: Percentage of customers predicted to churn.
- Customer Insights: Churn predictions segmented by demographics or service usage.
Visualizations:
- Bar Chart: Visualize churn rates by customer demographics (e.g., age group, contract type).
- Heatmap: Display churn probability across different customer segments.
- KPI Cards: Highlight key metrics like average churn probability and total predicted churn.
Example DAX Measures:
Create a measure for the churn rate:
Churn Rate =
DIVIDE(
COUNTROWS(FILTER(churn_predictions, churn_predictions[predicted_class] = 1)),
COUNTROWS(churn_predictions)
)
Step 4: Publishing and Sharing the Dashboard
- Publish the Power BI report to the Power BI Service:
- Go to File > Publish > Publish to Power BI.
- Share the dashboard with stakeholders:
- Navigate to the Power BI workspace.
- Select the report and click Share.
- Set up scheduled refresh to keep the dashboard updated:
- Go to Dataset > Schedule Refresh and configure credentials for the Azure SQL Database.
Key Takeaway
By integrating Azure ML insights with Power BI, businesses can create interactive dashboards that make churn predictions actionable. From real-time updates to detailed segment analysis, this approach empowers stakeholders to make informed decisions and improve customer retention strategies.
Read More
View all posts
AI/ML
Why Enterprise AI Must Be Application-Led, Not Agent-Led
A deep dive by Todd Bernson, CTO and Chief AI Officer, on why enterprise AI systems should be architected as application-led, deterministic platforms with embedded agentic AI—not fully autonomous agents. This article explains how API-first, governed, multi-channel architectures deliver higher reliability, compliance, scalability, and business value in real-world Fortune-500 environments.

Todd Bernson
2025-12-02

AI/ML
Application-First Agentic AI
Application-first agentic AI is emerging as the only reliable path to real enterprise ROI. In this in-depth analysis, Todd Bernson, CTO & CAIO, breaks down why most generative AI initiatives stall in production—and how disciplined enterprise architecture, deterministic workflows, and narrowly scoped AI agents can finally unlock repeatable business value. Using a real sprint-intelligence system as a case study, the article shows how organizations can combine serverless engineering, structured orchestration, and constrained LLM reasoning to reduce reporting effort, increase trust, eliminate hallucinations, and deliver actionable insights across engineering, operations, compliance, and customer experience.

Todd Bernson
2025-11-28
AI/ML
Why 95% of AI Projects Fail and How to Be Among the 5% That Succeed

Lee Hylton
2025-08-22