Forum Discussion
Customer segmentation using DATESINPERIOD
- Anonymous6 years ago
Hey,
I gave it a try and that's the solution that worked for me. You will see that I used DatesBetween instead of DatesinPeriod. But I'm sure that it may work in both ways.
Below the results I got.
Hope it helps.
Hi v-frfei-msft ,
Unfortunately I can't share the underlying data, however I've created two dummy tables in this excel sheet. The table on the left, '1_Orders', is the main base table I'm using (in conjunction with a dates table). The table on the right, 'Active customers', is the expected outcome, which I'm not currently getting.
Essentially, I would like to look at each customer and for each date, sum the # orders they had in the preceding 28 days. I'm not sure if I've gone about it in the right way, but that is the goal 🙂
Thanks a lot for your help!
Hey,
I gave it a try and that's the solution that worked for me. You will see that I used DatesBetween instead of DatesinPeriod. But I'm sure that it may work in both ways.
Below the results I got.
Hope it helps.
- Mattonpowerbi6 years agoFrequent Visitor
Hey Anonymous , that's perfect, thanks a lot 🙂 I'm not sure why what I had done didn't work, I'll have a think about that one!