Forum Discussion

dgdgdg122db's avatar
dgdgdg122db
Icon for Helper II rankHelper II
6 years ago
Solved

Recalculate occurrence base on year

Hi,

I currently have the occurrence calculation of my customers from the entire time frame (2019 -2020)

However I what I want to achieve is to calculate the occurrences base on different years, meaning recalculate the occurrence from the beginning of next year:

DatecustomerIDOccurrence
1-1-20191231
1-2-20191232
1-3-20201231
1-4-20211231

 

  • Add filter in the formula

    && 'unique order customer'[Year] = earlier( 'unique order customer'[Year])

4 Replies

  • Add filter in the formula

    && 'unique order customer'[Year] = earlier( 'unique order customer'[Year])

    • dgdgdg122db's avatar
      dgdgdg122db
      Icon for Helper II rankHelper II

      Hi amitchandak  could you please tell me where I should add the second filter specifically, I have tried and I kept getting errors, thank you 

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        in the filter where [unique customer no.] end give space and add a filter for the year.

         

        else please give your formula in text format

  • v-kelly-msft's avatar
    v-kelly-msft
    Icon for Community Support rankCommunity Support

    Hi dgdgdg122db ,

     

    Use a dax expression  as below:

     

     

    Customer occurrence=countx(filter('Unique Order customer','Unique Order customer'[Customer No.]=EARLIER('Unique Order customer'[Customer No.]&&'Unique Order customer'[Year]=EARLIER('Unique Order customer'[Year]),'Unique Order customer'[Customer No.])

     

     

    Best Regards,
    Kelly
     
    Did I answer your question? Mark my post as a solution!