Forum Discussion
RFM Model - How to create a Cluster Record to visualize evolutiong throught time?
Hi Anonymous ,
Do you want to calculate this based on the update date of the information or on the order date?
I have prepared a setup based on a date dimension table and the difference to the selected value of the orders.
So basically just replace your TODAY() from your days without orders to a MAXIMUM date, and all the formulas are with measures.
I will send the explanation and file between today and tomorrow.
I want to calculate based on the update date, for example: How many of each clusters I had on December 1st, how many on December 2nd, throught every day. Also would be nice to see how many of each clusters through the months:
How many cluster when I was in 31 October, 30 November, and so on...
Did you get it?
Thank you very much!!
- MFelix5 years agoSuper User
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.
- MFelix5 years agoSuper User
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