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.
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.