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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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/

vs_7
Responsive Resident
Responsive Resident

hi,

 

i refer suggested link , but below error is showing.

 

vs_7_0-1647328787514.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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