Forum Discussion

actroyani's avatar
actroyani
Regular Visitor
4 years ago
Solved

Check if a value exists previously

Hi, I would like to know how to create a new column where I get the value "New" if a person exists in previous months of my data and "Old" if it exists in previous months or if it's the first month ...
  • amitchandak's avatar
    4 years ago

    actroyani ,

    a new column =

    var _1 = countx(filter(Table, [Person] = earlier([Person]) && [Date] < earlier([Date] ) ), [Person]) +0

    return

    if(_1 > 0, "Old", "New")