Forum Discussion
Dynamic New Customer count
- 6 years ago
- Anonymous6 years agoNot applicable
I know why the smile on your face....
This works great. However since I am new to DAX let me see if I understand.
They way you think is that for every sales fact, you create a measure that would evaluate if this is a new customer (or first sales) or not. Then we only have to count the rows.
So the calc is simple. We do a count on the customer number where the the date of first interaction is greater than the min date table during the current time frame selected, and the date of first interaction = the date of a first interaction for any product.
Now let me know if I understand the two basic measures.
The date of first interaction is the min(sales Date) for all the date within the calendar. However it might be dynamically filtered by product category.
The date of first interaction for any product, is the minimum date for all product category. The all(product category) ignores the filter.
Your solution works great. However, if I add another type of category:
Date of first interaction for any product = CALCULATE(MIN(Sales[Sale_date]),DATESBETWEEN('Calendar'[Date],MINX(ALL('Calendar'),'Calendar'[Date]),MAX('Calendar'[Date])),ALL(Sales[Product Category]),ALL(Sales[Product other_category])It does not behave the same. I thought I could just add this new filter but it does not change the calculation on other_category.==============
Also, instead of talking nuts and bolts. I like the concept of row level measures instead of aggregating at Fiscal year level.Is it customary to think this way? Are there any performance issue with this?Thanks
Francois- Ashish_Mathur6 years agoSuper User
Hi,
You are welcome. Your understanding is correct. Your edited formula should work - I do not know why it isn't. I will need your file with that column added and clearly show me in the visual that the result is wrong.