Forum Discussion

Fangyi8's avatar
Fangyi8
Frequent Visitor
3 years ago
Solved

Client Classification

Hi guys, please I need your help with classifying customers according to the following criteria, New client - made a one purchase in the month of December 2023, Active client - made a purchase thi...
  • v-zhangti's avatar
    3 years ago

    Hi, Fangyi8 

     

    You can try the following methods.
    Sample data:

    Classification = 
    Var _currentmonth=CALCULATE(COUNT('Table'[Date of the deal]),FILTER('Table',MONTH([Date of the deal])=MONTH(TODAY())
                                                                                &&[Name of clients]=EARLIER('Table'[Name of clients])))
    Var _newclient=CALCULATE(COUNT('Table'[Date of the deal]),FILTER('Table',[Name of clients]=EARLIER('Table'[Name of clients])))
    Var _last60day=CALCULATE(COUNT('Table'[Date of the deal]),FILTER('Table',[Date of the deal]>=TODAY()-60
                                                                             &&[Date of the deal]<MAX('Table'[Date of the deal])
                                                                            &&[Name of clients]=EARLIER('Table'[Name of clients])))
    Return
    SWITCH(TRUE(),
    _currentmonth=1&&_newclient=1,"New client",
    _currentmonth>=1&&_last60day>=2,"Active client",
    _currentmonth=1&&_last60day=1,"Passive client",
    _currentmonth>=1&&_last60day=BLANK(),"Returning client",
    _last60day=BLANK(),"Lost client")

    Please check the attachment.

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.