Forum Discussion
Pinoo39
5 years agoFrequent Visitor
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" col...
amitchandak
Super User
5 years agoPinoo39 , 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()))
Pinoo39
5 years agoFrequent Visitor
MINX and MAXX require two arguments