Forum Discussion

CL7777's avatar
CL7777
Helper III
6 years ago
Solved

Counting repeat customers

HEllo Forum,   I am an intermediate dax user and Im struggling with this task   I want to count repeat customers in a table, keeping all filters applied in the visual.   Example file customer ...
  • PaulDBrown's avatar
    PaulDBrown
    6 years ago

    CL7777 

     

    I see what you mean. Tricky this one, but I think I've cracked it.

    Give this a try:

    1) First measure: 

    Distinctcount years = CALCULATE(DISTINCTCOUNT('Customer data'[year]); 
                          ALLEXCEPT('Customer data'; 
                          'Customer data'[Customer]; 'Customer data'[Country];'Customer data'[part number]))

    2) Final Measure to deliver repeating customers:

    Repeating Customers = CALCULATE(DISTINCTCOUNT('Customer data'[Customer]);
                           FILTER(ALL('Customer data'[Customer]);
                            [Distinctcount years]>1)) +0