Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Clientes inativos

Olá, eu tenho uma tabela de movimento dos clientes que tem as seguintes colunas:

id_cliente

[count_mov_cliente] --- (dax formula)

id_calendario

 

E tenho uma tabela para o calendario e outra para os clientes.

 

Quero calcular os clientes sem movimentos em 6 ou mais meses.

 

A tabela de calendario tem datas até 2030.

 

Por favor ajuda.

  • Anonymous , first have 6 month rolling measure

     

    Rolling 6= CALCULATE([count_mov_cliente],DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH))

     

    then create a measure like

     

    countx(values(Table[id_cliente]) , if (isblank([Rolling 6]) , [id_cliente], blank()) )

5 Replies

  • Anonymous , first have 6 month rolling measure

     

    Rolling 6= CALCULATE([count_mov_cliente],DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH))

     

    then create a measure like

     

    countx(values(Table[id_cliente]) , if (isblank([Rolling 6]) , [id_cliente], blank()) )

  • Anonymous , first have 6 month rolling measure

     

    Rolling 6= CALCULATE([count_mov_cliente],DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH))

     

    then create a measure like

     

    countx(values(Table[id_cliente]) , if (isblank([Rolling 6]) , [id_cliente], blank()) )

  • Anonymous's avatar
    Anonymous
    Not applicable

    Obrigada por responder, mas  a minha tabela de calendario vai até 2030, o MAX('Date'[Date ])  irá trazer o 2030 não? 

     

    fiz a seguinte adaptação mas não sei se está correcto: 

    Rolling 6 = CALCULATE([Count_mov_cliente],DATESBETWEEN('d calendar'[DATA], TODAY()-30, TODAY()))      

     

     

    e no segundo dax, a minha tabela de moviemntos é uma factual, posso usar o distict count?

  • Anonymous's avatar
    Anonymous
    Not applicable

    fiz a seguinte adaptação : 

    Rolling 6 = CALCULATE([Count_mov_cliente],DATESBETWEEN('d calendar'[DATA], TODAY()-30, TODAY()))
     
     
     
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous,

      Did the above suggestions help with your scenario? If that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements.

      If they also don't help, please share some dummy data that keep raw data structure with expected results to help us clarify your scenario and test to coding formula.

      How to Get Your Question Answered Quickly 

      Regards,

      Xiaoxin Sheng