Forum Discussion

Index_Match's avatar
Index_Match
Frequent Visitor
4 years ago
Solved

Measure Repeat Customer by Date

Hi all,   I think I have a somewhat easy question, but I'm having a hard time solving. I'm try to find the count of repeat customers by year, comparing this year to the previous year. For example, ...
  • VahidDM's avatar
    4 years ago

    Hi Index_Match 

     

    Try this measure [without Date Table]:

    Repeat Customers =
    VAR _A =
        ADDCOLUMNS (
            Customer,
            "CY",
                CALCULATE (
                    DISTINCTCOUNT ( Customer[Customer] ),
                    FILTER (
                        ALL ( customer ),
                        YEAR ( Customer[Year] )
                            = YEAR ( EARLIER ( Customer[Year] ) ) - 1
                            && Customer[Customer] = EARLIER ( Customer[Customer] )
                    )
                ) + 0
        )
    RETURN
        SUMX ( _A, [CY] )

     

     

    output:

     

     

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!
    LinkedIn: 
    www.linkedin.com/in/vahid-dm/