Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
TelPowerBI104
New Member

Counting Dates in Customer Table Column, organised by Date Month

Hi PowerBi Community.


First Post. 

 

I have a table of 13k Customers (Customer Table) and I have written a simple (Measured Column) query to look into the Orders Table to discover what date the first order was placed by each customer. This returns the date as a new column (First Order Date) in Customer Table. I also have a table to calculate all my calendar functions. 

 

What I want to do now is tally all those dates in First Order Date to find how many new customers we have each month/year. I have crawled through the web trying various methods but I cannot get any to work so I wanted to create a fresh blog to ask for expert advice. I cna share more detail if needed . . .

 

Plese help 🙂

 

Terry

2 ACCEPTED SOLUTIONS
johnt75
Super User
Super User

Link your calendar table to your customers table on the first order date column, and make sure that the calendar table is marked as a date table.

Then you can create a simple measure like

Num new customers = COUNTROWS( Customers )

and use that in visuals with columns from your calendar table.

View solution in original post

Anonymous
Not applicable

Thanks for the reply from johnt75 , please allow me to provide another insight:

Hi, @TelPowerBI104 

johnt75's solution is a good idea.

To facilitate your understanding, I have created the following example:

1.Firstly, here is my sample data:

vlinyulumsft_0-1733906825825.png

2.Secondly, I created the following measures:

Measure = COUNT('customer_data'[CustomerID])

Of course, there are many functions in DAX similar to the COUNT() function we are using. Please refer to:

COUNT function (DAX) - DAX | Microsoft Learn
COUNTA function (DAX) - DAX | Microsoft Learn
COUNTAX function (DAX) - DAX | Microsoft Learn
COUNTBLANK function (DAX) - DAX | Microsoft Learn
COUNTROWS function (DAX) - DAX | Microsoft Learn
 

3.Next, apply it to the visualisation object:

vlinyulumsft_1-1733906890626.png

4.Here's my final result, which I hope meets your requirements.

vlinyulumsft_2-1733906890628.png

vlinyulumsft_3-1733906901942.png

 

Please find the attached pbix relevant to the case.

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
TelPowerBI104
New Member

Thank you both solutions worked and increased my learning. I think I was over complicating my approach. 

Anonymous
Not applicable

Thanks for the reply from johnt75 , please allow me to provide another insight:

Hi, @TelPowerBI104 

johnt75's solution is a good idea.

To facilitate your understanding, I have created the following example:

1.Firstly, here is my sample data:

vlinyulumsft_0-1733906825825.png

2.Secondly, I created the following measures:

Measure = COUNT('customer_data'[CustomerID])

Of course, there are many functions in DAX similar to the COUNT() function we are using. Please refer to:

COUNT function (DAX) - DAX | Microsoft Learn
COUNTA function (DAX) - DAX | Microsoft Learn
COUNTAX function (DAX) - DAX | Microsoft Learn
COUNTBLANK function (DAX) - DAX | Microsoft Learn
COUNTROWS function (DAX) - DAX | Microsoft Learn
 

3.Next, apply it to the visualisation object:

vlinyulumsft_1-1733906890626.png

4.Here's my final result, which I hope meets your requirements.

vlinyulumsft_2-1733906890628.png

vlinyulumsft_3-1733906901942.png

 

Please find the attached pbix relevant to the case.

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

johnt75
Super User
Super User

Link your calendar table to your customers table on the first order date column, and make sure that the calendar table is marked as a date table.

Then you can create a simple measure like

Num new customers = COUNTROWS( Customers )

and use that in visuals with columns from your calendar table.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.