Forum Discussion

awitt's avatar
awitt
Helper III
7 years ago
Solved

Unique Value Count

Looking to create a measure or a column that identifies when a value reoccurs within a data set but isolates the multiple times it shows up in one unique occurance.    Basically i am looking to ret...
  • MitchM's avatar
    MitchM
    7 years ago

    I just reproduced your data set and, using this code, see this:

     

    New/Recurring = 
    VAR EarliestDate = 
        CALCULATE(
            MIN( Table2[date] ),
            ALLEXCEPT( Table2,Table2[Customer #] )
        )
    
    RETURN 
        IF(
            SELECTEDVALUE( Table2[date] ) = EarliestDate,
            "New",
            "Returning"
        )

     

     

    Are you using the date column in the table with the rest of the data or a date table? The way the measure works is to find the the unique earliest date for each Customer. Not sure how a date table would impact this.