Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Thanks to another post, I was able to figure out how to get a count of members who visited for the first time in the selected date range.
Now, I am looking to compare that count with the number of first time visitors from the previous year.
I was hoping it would be easy to just put a DATEADD on the currentDate VAR, but I run into syntax errors.
Does anyone have any ideas on how to get last year's first time visitors?
This is the DAX to retrieve the current count:
(fact_branch_checkin_inc has all 9.2B visit records with the durable_member_key)
New visitors LY =
VAR currentMembers = VALUES(fact_branch_checkin_inc[durable_member_key])
VAR currentDate = MIN(dim_date[full_date])
VAR pastMembers = CALCULATETABLE(VALUES(fact_branch_checkin_inc[durable_member_key]),
ALL(dim_date[full_date].[Month],dim_date[full_date].[MonthNo],dim_date[full_date].[Year])
, dim_date[full_date]< currentDate)
VAR newCustomers = EXCEPT(currentMembers,pastMembers)
RETURN COUNTROWS(newCustomers)
Thanks in advance!
Solved! Go to Solution.
first time mean, the person did not came last year ?
New customer is the one you are looking for
YTD = calculate([Sales],datesytd('Date'[Date]))
LYTD = calculate([Sales],DATESYTD(DATEADD('Date'[Date],-1,MONTH)))
Lost Customer= Sumx(VALUES(Customer[Customer Id]),if(ISBLANK([MTD]) && not(ISBLANK([LMTD])) , 1,BLANK()))
New Customer= sumx(VALUES(Customer[Customer Id]), if(ISBLANK([LMTD]) && not(ISBLANK([MTD])) ,1,BLANK()))
Retained Customer= if(not(ISBLANK([MTD])) && not(ISBLANK([LMTD])) , 1,BLANK())
Also refer if needed
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...
Thank you!
first time mean, the person did not came last year ?
New customer is the one you are looking for
YTD = calculate([Sales],datesytd('Date'[Date]))
LYTD = calculate([Sales],DATESYTD(DATEADD('Date'[Date],-1,MONTH)))
Lost Customer= Sumx(VALUES(Customer[Customer Id]),if(ISBLANK([MTD]) && not(ISBLANK([LMTD])) , 1,BLANK()))
New Customer= sumx(VALUES(Customer[Customer Id]), if(ISBLANK([LMTD]) && not(ISBLANK([MTD])) ,1,BLANK()))
Retained Customer= if(not(ISBLANK([MTD])) && not(ISBLANK([LMTD])) , 1,BLANK())
Also refer if needed
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...
User | Count |
---|---|
101 | |
90 | |
79 | |
70 | |
70 |
User | Count |
---|---|
112 | |
96 | |
96 | |
75 | |
72 |