Forum Discussion
Unique Value Count
- 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.
Will this measure work?
New/Recurring =
VAR EarliestDate =
CALCULATE(
MIN( Table1[date] ),
ALLEXCEPT( Table1,Table1[company] )
)
RETURN
IF(
SELECTEDVALUE( Table1[date] ) = EarliestDate,
"New",
"Returning"
)No - unfortunately that is showing everything as new.
- MitchM7 years agoResolver II
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.
- awitt7 years agoHelper III
I think relating the date table is messing something up. When i use the data within this specifc data, your solution works. Thanks!