Forum Discussion
RFM Model - How to create a Cluster Record to visualize evolutiong throught time?
Hi Anonymous ,
You don't have an updated date on your file. So you are not saving daily information, you refer that you overwritte the data so without that date this is not possible to do.
Regarding month by month I have everythi prepared.
Hi Anonymous ,
I created the following measures:
Last Order Date = MAX(Orders[created_at])
Days Without Order Number = DATEDIFF([Last Order Date];MAX(DimDate[Date]);DAY)
Recency Note value =
SWITCH (
TRUE ();
[Days Without Order Number] < 7
&& [Last Order Date] <> BLANK (); 5;
[Days Without Order Number] >= 7
&& [Days Without Order Number] < 14; 4;
[Days Without Order Number] >= 14
&& [Days Without Order Number] < 30; 3;
[Days Without Order Number] >= 30
&& [Days Without Order Number] < 60; 2;
[Days Without Order Number] >= 60
&& [Days Without Order Number] < 90; 1;
0
)
Also created a dimension table with dates and another one with the clusters:
IDCluster
| 5 | Champions |
| 4 | Loyal |
| 3 | Potencial Clientes |
| 2 | Need Attention |
| 1 | Almost Lost |
| 0 | Lost |
Now add the following measure:
Cluster_Count =
VAR temptable =
SUMMARIZE ( Clients; Clients[id]; "Recency"; [Recency Note value] )
RETURN
IF (
MAX ( DimDate[Date] ) <= MIN ( Orders[created_at] );
BLANK ();
CALCULATE (
COUNTROWS ( FILTER ( temptable; [Recency] IN VALUES ( 'Cluster'[ID] ) ) )
)
)
See result below:
The two slicers on the bottom are for the order dates and for the date dimension table that will allow to have filters. these two slicers are sincronized with each other.
Check file attach, and if you need any further assistance please tell me.
- Anonymous5 years agoNot applicable
Hey MFelix
Thank you very much for your help, I sent a mock up file just to understand the solution, but actually there is others parameters to identify a cluster. I just did not understand the Cluster Count part, I am sharing another power bi file with you, with all the parameters that actually counts.
Just for you to follow, I have the recency note, the frequency note and other parameters like (first date order, amout of orders) that I used IF Conditional to create each one of the clusters inside the Clients Table.
Would you mind to have a look at this new file, it has the same idea, but it is a bit more complex.
Thank you very much in advance.
I saw that you come from Portugal, this other file is in Portuguese, because actually this file comes from Brazil haha
Please let me know if you can understand the tables, the measures and the calculated columns
https://drive.google.com/file/d/1oTaTjwouSF46nYiAxzeq3L5ueiirrgzI/view?usp=sharing
- MFelix5 years agoSuper User
Hi Anonymous ,
Big file, I will have a look at it and will get back to you ASAP.
- Anonymous5 years agoNot applicable
MFelix thank you very much!!
I think it will be a bit harder to come up with a solution because there are actually too many variables to determinate all the clusters