# Top Customer Per Product – Power BI Analysis

This tutorial involves finding out your top customer per product using an advanced Power BI analysis. This example perfectly shows how Power BI can generate practical insights once you utilize it effectively. There’s just no other tool out there that’s as versatile and flexible as Power BI. You may watch the full video of this tutorial at the bottom of this blog.

Moreover, it’s all just a matter of understanding the DAX formula language and combining different functions together to be able to extract amazing insights.

This tutorial enables you to see the names of the top purchasing customers per product and get other insights based on the original list.

It’s interesting how you can achieve this by combining a few techniques. Once you become more familiar with the key concepts of Power BI, you can easily make your way through this example. For now, let’s work through the formula for calculating the top customer.

## Calculating The Top Customer

First, click New Measure, and then rename the measure as Top Customer.

You need to do a ranking calculation to get the names of the top customer. Since you need to return a value, you can use either the MAXX or MINX function.

For this scenario, it’s best to use the MAXX function because you need to find the top purchasing customer. This function is an iterator, so you need to put a virtual table inside the calculation that should be based on ranking. The MAXX function here will rank the customers based on the revenue that they generated.

The next thing that you should add to the equation is the TOPN function. It’s going to put a virtual table inside of the table parameter and then return the top one.

You also need to create another summary table by using the SUMMARIZE function. This virtual table contains all the customers and their revenues. In the table, the first column will be for Customer Names and the second column is for Total Revenue.

Now, you need to establish an order for the customers. You just need to reference the Total Revenue column inside of SUMMARIZE. After that, you can sort the customers by revenue in a descending order so that the customers with the highest revenues are placed at the top of the list.

To return the name of the top customer, you need to reference the Customer Name column in the formula.

Once you’re done with the formula, bring it into the table to see the corresponding results. In the Top Customer column, you can see the list of top customer by revenue for each day. You can also click any part of the graph to view the top customer of a specific region.

This might be a tricky formula, but combining these techniques in a number of different ways can actually create lots of great insights. For instance, if you’re selling different products, you can find out your top selling day or top product.

## Extracting Top Customer Data From Different Channels

You can also put this insight into a matrix and extract other customer data from different channels.

For instance, you can grab the channel dimension from the sales table and put it into the columns.

This is how the visualization would look after you put the Channel table into the columns.

There is a lot of product information and you can get the list of top customers from the different channels like Distributor, Export, Wholesale, and more.

For dynamic results, you can also click on the different regions to recalculate the top customers accordingly.

## Working Out The Top Revenue

Lastly, you can try and work out your top revenue using the same pattern that you used for calculating the top customer.

Just copy the existing formula, and then create a new measure and rename it as Top Customer Revenue.

Using the copied formula, just change the Customers[Customer Names] part into Rev.

You can save it, and then bring it into the table to see the corresponding results under the Top Customer Revenue column.

## Conclusion

Understanding and knowing your top customers is one of the key things to do to have a strong customer relationship.

I hope you got a lot of insights from the techniques that I have showed you. The formula is somewhat easy to replicate and works really well, so I hope you can apply it to your own business data.

Cheers to more learning!

Sam

Sam McKay, CFA
Sam is Enterprise DNA's CEO & Founder. He helps individuals and organizations develop data driven cultures and create enterprise value by delivering business intelligence training and education.

## R Scripting For Power BI Using RStudio

In this blog, we’re going to go through the basics of R scripting for Power BI using RStudio. The...

## Simple Aggregations In Power BI

In this blog post, I'll touch on some simple aggregations in Power BI that you can use in your DAX...

## Microsoft Report Builder: Steps In Creating A List

In this tutorial, you will learn how to create a list and page break in Microsoft Report Builder. A...

## 5 Strategies To Enhance Your Power BI DAX Skills

In this tutorial, you’ll learn the general strategies to improve your DAX or M capabilities. This is an...

## ALL Function in Power BI – How To Use It With DAX

Did you know that the ALL function can be used to modify the context of a particular calculation in...

## Calculations In Power BI Using Measure Branching

Measure Branching is a technique in making calculations in Power BI. It's not something you'll hear...

## Power BI Ranking In Hierarchical Form

Today, we will learn how to calculate Power BI ranking in a hierarchical form which is a little bit...

## Understanding Power BI Aggregations

Now, let's delve deeper into one of the most important concepts in Power BI calculations — the...

## Using Python In Power BI | Dataset And String Function

In this tutorial, we'll discuss how you can create and prepare Dataset and String Function using Python...

## Announcing The Enterprise DNA Submit A Showcase Program

Today we are launching a brand-new program here at Enterprise DNA. We are looking to collaborate with...

## Inventory Management Reports To Show Trends In Sales

This Enterprise DNA Power BI Showcase focuses on Inventory Management. You may watch the full video of...

## Huff Gravity Model Analysis in Power BI

In this tutorial, we'll learn how to do a Huff Gravity Model analysis in Power BI. We can use this...