To calculate RFM scores, you first need the values of three attributes for each customer: 1) most recent purchase date, 2) number of transactions within the period (often a year), and 3) total or average sales attributed to the customer (total or average margin works even better).