Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Active / LeavingCustomers Measures

Hello,    I am creating column chart by years/yearmonths with customers segmented by their activity:   Active Customer:  customer has status 'active'  up to 15 month after his order.  Measure is ...
  • Greg_Deckler's avatar
    Greg_Deckler
    6 years ago

    Anonymous - Try this out:

    Leaving Customers =
      VAR __Today = TODAY()
      VAR __Table = 
        ADDCOLUMNS(
          ADDCOLUMNS(
            SUMMARIZE('Table',[CustomerEmail],"End15",MAX([Until 15M])),
            "16",EOMONTH([End15,1])
          ),
          "Leaving",IF(__Today > [End15] && __Today <=[16],1,0)
        )
    RETURN
      COUNTROWS(FILTER(__Table,[Leaving]=1))
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous,

    I'd like to suggest you take a look at following link about hr employee analytic if it meet your requirement:

    HR Data - Slowly Changing Dimensions 

    Regards,

    Xiaoxin Sheng