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.
Hello there!
I've been away from PBI for some months, so I've been struggeling with this problem the past week, and I'm all out of ideas.
I tried variations of 'Basket Analysis'-measures, but couldn't make it work.
I have the following sample data:
CustomerID | OrderID | Date | Product |
Alberto | 10100 | 26-11-2020 | A |
Albterto | 10100 | 26-11-2020 | B |
Alberto | 10101 | 28-11-2020 | X |
Marco | 10102 | 01-12-2020 | Y |
Marco | 10103 | 06-12-2020 | B |
Patrick | 10104 | 10-12-2020 | A |
Patrick | 10105 | 17-12-2020 | B |
Reza | 10106 | 20-12-2020 | X |
Reza | 10107 | 23-12-2020 | Y |
Reza | 10108 | 25-12-2020 | B |
A marketing team launched an "After-purchase" campaign, sending giftcodes for product X and Y to people who did not already purchase product X or Y in their first order.
Therefore, they want to know how many customers, who did not buy X or Y in their order; purchased X or Y in their second order.
In other words, they want to know how many customers behaved as Alberto.
I've seen a bunch of measures for 'first order basket' and retention analysis, but the criteria of X and Y not to be included in the first order, is really bothering me.
Any help is much appreciated.
Regards.
Solved! Go to Solution.
HI @Anonymous
Please try below
Measure =
var _min_ord = CALCULATE(MIN('table'[OrderID]),ALLEXCEPT('table','table'[CustomerID]))
var _min_XY = CALCULATE(MIN('table'[OrderID]),ALLEXCEPT('table','table'[CustomerID]),'table'[Product] = "X" || 'table'[Product] = "Y")
var behaved_as_alberto = IF(_min_ord < _min_XY,1,0)
Return CALCULATE(DISTINCTCOUNT('table'[CustomerID]),behaved_as_alberto = 1)
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
@Anonymous See attached solution, I have created few measures to break it down and to understand how it all works, you can tweak it and collapse the measures as you see fit.
In the attached file there are many tables, just ignore all those and focus on the table name called Basket.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi,
You may download my PBI file from here.
Hope this helps.
@Anonymous See attached solution, I have created few measures to break it down and to understand how it all works, you can tweak it and collapse the measures as you see fit.
In the attached file there are many tables, just ignore all those and focus on the table name called Basket.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
HI @Anonymous
Please try below
Measure =
var _min_ord = CALCULATE(MIN('table'[OrderID]),ALLEXCEPT('table','table'[CustomerID]))
var _min_XY = CALCULATE(MIN('table'[OrderID]),ALLEXCEPT('table','table'[CustomerID]),'table'[Product] = "X" || 'table'[Product] = "Y")
var behaved_as_alberto = IF(_min_ord < _min_XY,1,0)
Return CALCULATE(DISTINCTCOUNT('table'[CustomerID]),behaved_as_alberto = 1)
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |