Forum Discussion

abloor's avatar
abloor
Icon for Helper IV rankHelper IV
7 years ago
Solved

Time since last spend column

Hi, I’m looking to create a report to show which of our clients are New, Lost or Retained. New = spent in the last 13 months only Lost= haven’t spent in the last 13 months Retained = have spent ...
  • amitchandak's avatar
    amitchandak
    6 years ago

    Assuming the formula you had only need the date change

     

    ClientRetention =
    VAR _today = max('Date'[Date])
    VAR max1 = CALCULATE ( MAX ( 'Data'[Month]), ALLEXCEPT ( 'Data', 'Data'[ClientName] ) )
    VAR min1 = CALCULATE ( MIN ('Data'[Month]), ALLEXCEPT ( 'Data', 'Data'[ClientName] ) )
    RETURN
    IF ( DATEDIFF ( max1, _today, MONTH ) > 13, "Lost",
    IF ( DATEDIFF ( min1, _today, MONTH ) = 1, "New",
    "Retained" )
    )