Forum Discussion
New Customers DAX
Hi all,
I'm using "DaxPatterns" article to calculate New Customers but couldnt find a way to filter some customers first. I need to filter Customers List based on an attribute (e.g. "Status" column in Sales Table) then use it in the formula.
I trid to define a variable like the following but it didn't work
This is the Code :
AND then number of New Customers is :
Any idea on doing that ?
6 Replies
- amitchandak
Super User
Pinoo39 , refer if my two blogs can help. You need change the duration for new (Last period )
Customer Retention Part 1:
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529
Customer Retention Part 2: Period over Period Retention :https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458- Pinoo39Frequent Visitor
Since I'm using a DimDate Other than Gregorian DimDate, function like DatesMTD are not gonna work correctly
- amitchandak
Super User
Pinoo39 , Try like, assuming a period is selected and the date table can give the dates for that period
This period =
var _min = minx(allselected('Date', 'Date'[Date]))
var _max = maxx(allselected('Date', 'Date'[Date]))
return
calculate([Sales], filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max) )
Last period =
var _min = minx(allselected('Date', 'Date'[Date]))
var _max = maxx(allselected('Date', 'Date'[Date]))
return
calculate([Sales], filter(all('Date'), 'Date'[Date] <_min) )New Customer This period = sumx(VALUES(Customer[Customer Id]), if(ISBLANK([Last period]) && not(ISBLANK([This period])) ,1,BLANK()))
- Pinoo39Frequent Visitor
MINX and MAXX require two arguments
- amitchandak
Super User
Pinoo39 , what is your defination of new
- Pinoo39Frequent Visitor
A customer is considered new if He/She has bought an item in the selected period on slicer (e.g. This month) and not in the past