Use Case Breakdown: Predicting Customer Churn with Azure

How to identify high-value customers at risk of churning and take proactive measures

Read time: 6 minutes

Hey there,

Today, we'll explore one of the most crucial AI use cases for businesses: customer churn prediction.

No matter the industry, retaining customers is crucial for long-term success.

In this newsletter, we'll discuss how to design a customer churn predictor for a subscription-based business using Microsoft's Azure and Power BI. Feel free to use this as a blueprint for your own business.

Let's dive in!

Churn prediction is one of the most popular ML use cases

Preventing customer churn is a vital aspect of maximizing business revenue and maintaining a loyal customer base. But customer churn comes in various forms:

  • For subscription-based businesses, such as SaaS or telcos, churn occurs when customers don't renew their contracts.

  • In transaction-based businesses, such as e-commerce, customers simply stop making purchases - which is much harder to measure.

So the type of churn solution you choose depends on your business.

Today, our focus will be on the subscription-based model.

In this industry, churn prediction can drive a huge impact, as this McKinsey quote shows:

And our work with telecom companies around the world reveals that those companies that implement a comprehensive, analytics-based approach to base management can reduce their churn by as much as 15%.

Problem Statement

Our goal is to predict the individual churn risk for each customer who currently has an active subscription. This allows us to identify high-value customers (high revenue or high purchase frequency) who are likely to churn and target them with a retention strategy.

Retention strategies can include a variety of tactics, such as improving customer service, offering personalized incentives and promotions, improving the quality of products and services, and providing better value.

Now, this should be obvious, but in practice it's often forgotten:

Having a good retention strategy is just as important (if not more important) than being able to predict churn.

In this post, however, we'll focus on the prediction aspect.

Solution Overview

Our solution architecture has three layers: The user layer, the analysis layer, and the data layer.

The overall approach is cloud-based which is both flexible and scalable. While we'll rely on Microsoft Azure and Power BI, it could be built with other technologies as well.

Solution Breakdown by Layer

Let’s walk through the layers step by step.

User Layer

The User layer serves as the front-end application that users interact with, and in our case, we'll use Power BI.

Power BI allows us to create insightful visualizations and dashboards that display our churn predictions, including high-value customers.

Our primary goal is to generate a Power BI report highlighting high-value customers at risk of churning and quantifying the associated financial risk.

Power BI manages the data model, merging the ERP/CRM data with churn predictions and calculating the most valuable customers.

Data Layer

The Data Layer involves accessing, preparing, and storing all necessary data for our analysis.

We begin the process by gathering historical data from a variety of sources, such as CRM systems, tracking data (such as Google Analytics or email tracking), and ERP data that tracks revenues.

The idea is to find signals that could predict churn.

For example, a customer that has not responded to any email from us for a long time and also has not interacted with our services could be at high churn risk. On the other hand, a customer with a lot of support tickets in the CRM could also be exposed to a higher churn risk.

To create an accurate churn prediction, we use machine learning algorithms trained on these historical data sets.

Using Power Query for Data Wrangling

But before we can do all this, we must bring the information together in a meaningful way. An effective tool to use is Power Query which helps us to merge these disparate datasets into one cohesive whole.

There are two ways you can use Power Query:

  • Power Query Online (e.g. via Power Platform and Dataflows)

  • Power Query for Desktop (e.g. in Excel and Power BI Desktop)

Once we've gathered all the necessary data, the next step is to clean it up so that it's consistent and reliable. This involves removing duplicate data entries, handling outliers or just generally addressing incorrect or inconsistent data points.

The last key task at hand is determining which customers have churned assigning a binary label: 0 for no churn and 1 for churn.

Remember, at this stage, we're still looking at historical data, so we should know which customers did and which ones did not renew their subscriptions.

The amount of historical data we need depends on the setup. For example, if you want to predict churn for monthly contracts, a few months of data may be sufficient. However, if you're looking into yearly contracts, you probably need data from the last 3-4 years at least.

Once we have all our data in order, it's time to upload it to Azure Machine Learning Studio for the actual analysis.

Analysis Layer

The Analysis Layer of our churn prediction system involves creating a machine learning model that predicts customer churn, given the historical churn labels. This process is known as Supervised Machine Learning.

In our case, we will use Azure Machine Learning Studio as our no-code platform to build the churn model.

In Azure Machine Learning Studio, we:

  1. Upload the cleaned and labelled data.

  2. Create a new AutoML job to predict churn labels based on all other variables (classification).

  3. Obtain an interpretable and high-quality model based on specific evaluation metrics.

  4. Deploy the model as a secured online REST API endpoint.

Once model training is complete, we move on to prediction. Given some input data, the model will return the probability that this customer will churn.

The hosted model expects data in the same format as during training (except it doesn't require the label).

To feed this data, we use a similar preprocessing workflow to merge ERP, CRM, and tracking data into the inference pipeline as we did for training. We can also do this in Power Query.

Power Query allows us to call the REST API and obtain churn predictions for each customer.

By now, the heavy lifting is done!

We can now store the predictions as a separate file or table in our database (Azure Blob Storage, Azure Synapse, SQL Server, or any other Power Query-compatible system).

The scored data is then ingested into Power BI along with CRM, ERP, and tracking data for further visualization and analysis in our report.


The outcome of our churn prediction system is twofold:

1. Understanding Churn Factors

The solution provides us with a better understanding of the factors that lead to customer churn, allowing us to develop targeted strategies for retaining customers and reducing costs associated with customer attrition.

2. Predicting Churn

The new dashboard enables us to predict which customers are most likely to churn, giving us analysis opportunities that were previously unavailable:

  • Identify high-value customers at risk of churning.

  • Assess the financial impact of potential churn.

  • Make data-driven decisions to retain these customers.

Overall, the churn prediction system provides valuable insights and actionable recommendations for businesses to enhance customer retention and drive profitability.

Of course, there are numerous ways to take this architecture to the next level. For example, we could further automate the process, or integrate it directly with CRM tools like Salesforce, allowing our salespeople to access the churn information without leaving their system.


By following the architecture above, you can build a scalable, enterprise-ready customer churn predictor for a subscription-based business using Microsoft Azure and Power BI.

This powerful approach enables you to identify high-value customers at risk of churning and take proactive measures to retain them.

I encourage you to try it out for yourself with some test data and explore the resources below to dive deeper.

How did you like today's use case?

Feel free to reply and let me know!

See you next Friday!


Want to learn more? Here are 3 ways I could help:

  1. Read my book: If you want to further improve your AI/ML skills and apply them to real-world use cases, check out my book AI-Powered Business Intelligence (O'Reilly).

  2. Book a meeting: If you want to pick my brain, book a coffee chat with me so we can discuss more details.

  3. Follow me: I regularly share free content on LinkedIn and Twitter.

Further Resources