Power BI

Clustering using Scatter Charts in Power BI

clustering-using-scatter-charts-in-power-bi

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.

Power BI data model showing relationships between Sales, Product, Date, Country, and Measures tables.

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

  1. First, click on the Scatter chart visual from the Visualizations Pane.

    Next, drag and drop the required fields into the Fields pane.
  2. Then, drag and drop the Product from Product_Table into the Details field.
  3. After that, drag and drop the Revenue from the All Measures table into the X Axis.
  4. Now, drag and drop the Profit Margin from the All Measures table into the Y Axis.
  5. Finally, drag and drop the COGS from the All Measures table into the Size field.
Scatter chart setup with Product, Revenue, Profit Margin, and COGS fields in Power BI.

Finally lets find clusters

6.Now click on three dots at the top right corner of scatter chart.

7.Click on Automatically find clusters.

Option to automatically find clusters in a Power BI scatter chart visual context menu

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 revenue and 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.

Are you looking for instructor-led Power BI or Power Apps training in Australia? We offer both classroom and live online training for the following courses:

Leave a Reply

Your email address will not be published. Required fields are marked *