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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
XLBob
Resolver II
Resolver II

Dynamic new customer count

I have sales and calendar table in my model. I am trying to do new customer count based on date selected. The definition of new customer is that customer must not have appeared in database til that reporting period. For example, if user selected Dec 2015, they only want to see customer who had sales only in Dec 2015. Obviously calculated column doesn’t help here as the new customer count is changing based on period selected. Also, the user wants to see this measure further broken down by other attributes such as city, age, etc.

 

I wrote a measure as below:
IF(CALCULATE(MIN('Sales'[Sales Date]),ALL('Dates'))>=MIN('Dates'[Date])&&CALCULATE(MIN('Sales'[Booking Date]),ALL('Dates'))<=MAX('Dates'[Date]),1,0)


What it does is give me the earliest sales date for each customer, if that date is between the min and max of selected date, count that as new customer. However this measure only works when you have customer key in the view. If I want to show number of new customers in each city for Dec 2015, my measure doesn’t work.

 

Any idea what’s the solution to this problem?

2 REPLIES 2
XLBob
Resolver II
Resolver II

I think below is exactly what I am looking for

http://www.daxpatterns.com/new-and-returning-customers/

Anonymous
Not applicable

hi,

 

i refer suggested link , but below error is showing.

 

vs_7_0-1647328787514.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.