Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |