Clustering using Scatter Charts in Power BI offers one of the simplest yet powerful AI features. It helps you discover natural groupings in your dataset before you dig deeper into the details. Power BI clusters your data by identifying meaningful similarities, intelligently detecting clusters while also allowing you to specify clustering requirements.
Clustering can be performed in Power BI with:
Scatter chart visual.
Table visual.
Custom visuals.
This blog post discusses clustering using scatter charts.
Preparing the Data Model for Clustering using Scatter Charts
For this blog post, we will use a simple sales dataset. The data model includes a fact table (Sales_Table) and three dimension tables (Product_Table, Country_Table, Date). We also created an additional virtual table that contains the measures used for clustering.
Business Questions to Explore with Clustering
Before we move any further, let’s define the business question we are considering.
Which products generate low revenue but have a high profit margin?
Which products generate low revenue and have a low profit margin?
Which products generate high revenue and have a high profit margin?
Which products generate high revenue but have a low profit margin?
Which products perform the best
Which products perform the worst?
Clustering the data for the given metrics can answer all the questions listed above. Let’s explore how to do this.
Begin by creating a scattered chart.
Guide to Creating a Scatter Chart for Clustering
First, click on the Scatter chart visual from the Visualizations Pane.
Next, drag and drop the required fields into the Fields pane.
Then, drag and drop the Product from Product_Table into the Details field.
After that, drag and drop the Revenue from the All Measures table into the X Axis.
Now, drag and drop the Profit Margin from the All Measures table into the Y Axis.
Finally, drag and drop the COGS from the All Measures table into the Size field.
Finally lets find clusters
6.Now click on three dots at the top right corner of scatter chart.
7.Click on Automatically find clusters.
8. Enter “4“ in the blank field under number of clusters.
9. Click OK
A new field Product (clusters) is created and added to the legend of scatter chart.
Let’s analyze each cluster separately
10.Now draw a Bar Graph with Product (clusters) in the axis value and Count of Product in the values.
11.Click on the bar against Cluster 1.
By using the clustering with scatter chart you have created Four clusters
Cluster 1:
The data points in this cluster are colored green and contain products that have relatively greater revenueand have provided a high profit margin.
Cluster 2:
The data points in this cluster are colored black and contain products that have lower revenue and have provided low profit margin.
Cluster 3:
The data points in this cluster are colored red and contain products that have high revenue but have provided a low profit margin.
Cluster 4:
The data points in this cluster are colored yellow and contain products that have lower revenue and have provided a high profit margin.
Every time the algorithm is run a different color is assigned to the clusters.
Editing Clusters
To edit clusters:
12. Click on the arrow next to Product (clusters) in the legend value.
13.Click on Edit Clusters.
A pop-up menu appears.
14. Type “3” in the number of cluste
15.Click OK.
You have now categorized products into three clusters: “Best Products”, “OK Products”, “Poorly Performing Products”.
Conclusion
Clustering is a powerful algorithm that helps uncover hidden relationships between different data points. In fact, it works like a magic wand by clearly identifying meaningful connections among those points. Moreover, you can perform clustering in Power BI by using scatter charts and table visuals. In this blog post, we provide a step-by-step guide to creating clusters using a scatter chart.