Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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 ?
@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()))
MINX and MAXX require two arguments
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
@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/b...
Customer Retention Part 2: Period over Period Retention :https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retenti...
Since I'm using a DimDate Other than Gregorian DimDate, function like DatesMTD are not gonna work correctly
User | Count |
---|---|
15 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
29 | |
17 | |
11 | |
7 | |
5 |