Forum Discussion

Hayleysea's avatar
Hayleysea
Icon for Resolver II rankResolver II
6 years ago
Solved

New row indicator against specific past date

Hi There,   I need a calculated column that indicates whether an ID is new when comparing to other date with a key indicator as per the example below:   ID Date Key Indicator Result A 1...
  • Hayleysea's avatar
    6 years ago

    I figured it out using some of what amitchandak said and making some changes.

    Ended up with a calculated column like this:

     

    Calculated Column=
    var keyindicatordate = CALCULATE(MAX(table[Date]), FILTER(table, table[keyindicator]="1"))
    var maxdate= CALCULATE(MAX(table[Date]), FILTER(table, Table[ID]=EARLIER(table[ID])))
    return IF(CALCULATE(DISTINCTCOUNT(table[ID]), FILTER(table, table[Date]=keyindicatordate && table[ID]=EARLIER(table[ID])))-CALCULATE(DISTINCTCOUNT(table[ID]), FILTER(table, table[Date]=maxdate && table[ID]=EARLIER(table[ID])))<0 && table[max week calculated column]=1,1,0)