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 a dataset where one customer can have multiple products. He can be live on certain products, but churned on other products.
He will only be marked as a churned customer if he is churned from all products.
How can I loop through the product status of each customer with DAX, checking if all of the statuses are lost, and then counting these up so I have the number of churned customers?
Example data:
Customer ID Product ID Status
1 1 Live
1 2 Lost
2 1 Lost
2 2 Lost
3 1 Live
3 2 Lost
The count I would want for the dataset above is 1, for customer 2. The other ones have Live deals so are not churned.
I tried using COUNTX/COUNTAX but to no avail, for example:
Solved! Go to Solution.
Try this:
Measure =
VAR __Table = SUMMARIZE('Table9',[Customer ID],"TotalCount",COUNTX('Table9',[Product ID]),"LostCount",COUNTX(FILTER('Table9',[Status]="Lost"),[Product ID]))
RETURN
COUNTROWS(FILTER(__Table,[TotalCount] = [LostCount]))
Your formula calculates the churns on deal level, not on customer level. I need the total count of customers for whom all deals are marked as churn.
its on customer level only.
In my data set i have taken customer as product ID and prod id as ID. Just rename the columns.
Thanks,
Pravin Wattamwar
Thank you, but this is not giving me back entirely what I need. This formula returns a count also when a client has churned on one product, but is live on another. How can I filter out the clients that do have a churn on one product but are live on another?
Example of the data where it goes wrong:
Product ID Client Lost Date Deal status
1 1 August 23,2018 Churned
2 1 Live
3 1 Live
This should not give me back a count as churned customer, but it did.
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 |
---|---|
46 | |
22 | |
20 | |
15 | |
13 |
User | Count |
---|---|
45 | |
41 | |
39 | |
19 | |
19 |