Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

NULL DATE CONDITIONAL COLUMN

HI, I have this table :

where fecha_ultimo_ingreso Column has null values (Type=Date), I need to add a conditional Column with 3 conditions ( date < 01-01-2021, then "VIEJO", date<01-01-2022 then "NUEVO", else "ACTUAL"), but I get errors when loading into the model, because of the null values, I tried to fix it as it can be seen in the image, but I can't get it recognized.  I tried to replace null values by 1900/01/01, but failed...How could it be done?. Thanks in advance!

  • Anonymous 

    pls try this

    if [Date] is null or [Date] < Date.FromText("2021-01-01") then "VIEJO"
    else if [Date] < Date.FromText("2022-01-01") then "NUEVO" else "ACTUAL"

3 Replies

  • Anonymous 

    pls try this

    if [Date] is null or [Date] < Date.FromText("2021-01-01") then "VIEJO"
    else if [Date] < Date.FromText("2022-01-01") then "NUEVO" else "ACTUAL"