Power BI Blog: Monthly New Customers
10 June 2021
Welcome back to this week’s edition of the Power BI blog series. This week, we will look at how to create a simple measure to count the number of new customers in a database for each month.
We are going to look at a simple database where we have three columns, the Date column, the ID column and the Sales column.
In this database, we are interested in counting the number of new customers each month. Let’s try to do this in DAX.
First, we shall need to count cumulative number unique customers in the dataset. We can do this with the following DAX code:
Cumulative New Customers =
This will provide the count of the cumulative total of unique customers for each month. Then, we can also calculate the accumulated total of new customers up to and including the previous month, so that we can subtract the two to calculate the new customers for the last period.
We can do this with the following DAX code:
# Customers Last Month =
Now we can simply subtract the two to obtain the number of new customers each month.
New Customers = [Cumulative New Customers] - [# Customers Last Month]