Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi everyone,
I'm trying to work on a Customer Churn Report and as a beginning step I need to classify customers as New,Retained and Lost for every month selected via a slicer. The logic here is to find if a customer has made a sale in the previous and current month and then to classify them as retained, lost, new for the current selected month.
I'm successful in getting the DAX and wanted result right for Retained Customers and Lost Customers, they're as follows:-
I'm not sure as to why that measure returns blank, I've tried to use ALL, DISTINCT functions and they don't quite do the job.
Solved! Go to Solution.
Hi @batmit25 ,
I thought of a possibility that could cause me to run fine but you can't show it. I'm using the latest version of Desktop, but when I open the pbix file you provided, it says that you are using an older version of Desktop, I suspect it's because of the version, you can try to use the newer version of Desktop and try again.
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-junyant-msft ,
Let me know if this helps or if I need to add anything more.Customer Churn - Error with Lost Customers
Hi @batmit25 ,
I used the measure you created earlier, and everything works fine...
I'm a little confused, maybe you have a problem with your previous operation? Please try again.
Hi @v-junyant-msft ,
That's really strange because in the below screenshots, I've applied the same DAX functions with and without slicer selecttion and also the same measure that you've recommended. Could it be an underlying setting in my Power BI Desktop that I need to turn on/off in order to see the results that you're able to see?
Hi @batmit25
I also tested it on a few of my colleagues' computers, and they all showed up fine. This is indeed a strange thing...
Let me do more testing to try and figure out what the problem is.
Hi @v-junyant-msft ,
Sure thing, Let me know if there's anything to be added from my side and Thank you again for the commitment and help!
Hi @batmit25 ,
I thought of a possibility that could cause me to run fine but you can't show it. I'm using the latest version of Desktop, but when I open the pbix file you provided, it says that you are using an older version of Desktop, I suspect it's because of the version, you can try to use the newer version of Desktop and try again.
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @batmit25 ,
You can use the following DAX to create a new column:
Lost Customers =
IF(NOT ISBLANK([Sales Last Month]) && ISBLANK([Sales This Month]), 1, BLANK())
New Customers =
IF(ISBLANK([Sales Last Month]) && NOT ISBLANK([Sales This Month]), 1, BLANK())
Retained Customers =
IF(NOT ISBLANK([Sales Last Month]) && NOT ISBLANK([Sales This Month]), 1, BLANK())
And the final output is shown in the following figure:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-junyant-msft ,
The IF conditions are right I believe!
Could I also know how you were able aggregate the Measures in order to show Total Customers(Lost,New,Retained). I used SUMX alongside but the values returned were blank.
Thank you again :))
Hi @batmit25 ,
The total of the previously provided solution is not calculated by DAX, but by the built-in calculation function of Power BI Desktop:
And if you want to calculate the total by DAX, you can try the following DAX to create a new measure:
Total Lost Customers = COUNTROWS(FILTER('Table','Table'[Lost Customers] = 1))
Or you can use this DAX as following:
Total New Customers =
SUMX(FILTER('Table','Table'[New Customers] = 1),'Table'[New Customers])
And the final output is shown in the following figure:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-junyant-msft,
The DAX measures work perfectly for Retained and New Customers, However while trying to aggregate the Lost Customers value. I run into the same problem of everything being blank.
I'm not sure whether it's related to how I modeled my data but if need be I can share my report(Just a trial report). Let me know if there's anything I can add to solve this issue.
Thanks again much appreciated!
Hi, @batmit25
Yes, you can share your report with me, but please note that before you share it, please check if it contains any private information (such as account number and password, etc.), and if so, please delete it before sharing.
I apologize, that's my first community post, I'll try to be more precise as I go. My question was as how to classify customers of a store as lost customers(The logic being if a customer made a purchase last month and dint make a purchase this month, Then they'd be a lost customer) with DAX.
Customer ID | Sales Last Month | Sales This Month |
A-123 | 23 | 25 |
B-123 | 12 | |
C-123 | 45 | |
D-123 | 35 | |
E-123 | 23 |
Sales This Month = CALCUALTE([Sales],DATESMTD[Date Table])
Sales Last Month = CALCULATE([Sales],DATESMTD(DATEADD([Date Table],-1,MONTH))
The following is the result I need,
Customer ID | Sales Last Month | Sales This Month | Lost Customer |
A-123 | 23 | 25 | |
B-123 | 12 | 1 | |
C-123 | 45 | ||
D-123 | 35 | 1 | |
E-123 | 23 |
I hope this was a bit more clear and concise, if not let me know how I could make the question more clear 😅.
I apologize again for the vague question; I tried to add as much context as I could as I'm a Novice at Power Bi. Thank you for the help!
We want to help you but your description is too vaugue. Please write it again clearly.
Please ask 1 question per ticket. Not 3 (new, lept and lost customers).
Please DON'T copy & paste your reports that does not work and expect us to fathom what you want to do. That is a bit crazy. 😀
Please just give a simple non technical functional decscription of what you want, then let us suggest the solution. Thank you.
Provide example input data as table text (not a screen print) so we can import the data to build a solution for you.
Also provide the example desired output, with a clear description of the process flow.
Remember not to share private data ... we don't want you to get into trouble. 😧
Take time and care to use the same table and field names in the input, output and description so we can understand your problem and help you.
Try keep it simple and ask one question per ticket.
You will get a quick response if you put time, care and effort into writing clear problem descriptions.
Vaugue descriptions can waste your time and ourtime.
Look foward to helping you when the above information is forthcoming
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
31 | |
14 | |
12 | |
10 | |
10 |