Dynamic new customer count

XLBob

Board Regular
Joined
Aug 17, 2012
Messages
65
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?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top