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.
I have used been using some DAX code for new and returning customers from sqlbi, though I am looking for a way to change/update the code to be able to show the Customer_TK in a matrix for Lost Customers.
Three other retention measures working, and when drill down to Customer_TK...
Working correctly. Now I add the Lost Customer measure....
This works great with the date, but....
Not when trying to see the breakdown with Customer_TK
How can I modify this DAX to allow the Lost Customer measure to be filtered by the customer dimension in this matrix.
Here is the DAX...
Lost Customers =
VAR LastDateLost =
CALCULATE(
MAX(dim_date[date]),
ALLSELECTED(dim_date)
)
VAR CustomersWithLostDate =
CALCULATETABLE(
ADDCOLUMNS(
VALUES(fact[CUSTOMER_TK]),
"@LostCustomerDate", [Date Lost Customer]
),
ALLSELECTED(dim_customer),
dim_date[date] <= LastDateLost
)
VAR LostCustomers =
FILTER(
CustomersWithLostDate,
[@LostCustomerDate]
IN VALUES(dim_date[date])
)
VAR Result =
COUNTROWS(LostCustomers)
RETURN
Result
Cheers
@fraserward , refer if my example can help
Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: https://www.youtube.com/watch?v=W4EF1f_k6iY
Hi amitchandak,
I will check out the video now. I think your link might be wrong though. I believe this would be the link you meant... https://www.youtube.com/watch?v=EyL7KMw877Q
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 |
---|---|
114 | |
99 | |
81 | |
70 | |
61 |
User | Count |
---|---|
148 | |
116 | |
104 | |
90 | |
65 |