Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Return a current year date column from another date column

Hi,

 

am having  Date column only in a table

If date column having this year Dates then return new column as this year dates.

 

Date                   Expected_Output

 

01/12/2018

01/01/2019           01/01/2019

01/12/2017

01/12/2019           01/12/2019     

 

how can i achieve this one?

 

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    ,DATE, in the given function should instead refer to the date column:

     

    expected_output= IF(YEAR(table[Date]) = YEAR(TODAY()),table[Date],BLANK())

3 Replies

  • dobregon's avatar
    dobregon
    Impactful Individual

    Maybe i don't understand well your point but i think if you want in columns it need to be a mixure of ifs

    expected_output= IF(YEAR(table[Date]) = YEAR(TODAY()),DATE,BLANK())

    Try this

    • Anonymous's avatar
      Anonymous
      Not applicable

      Error occurs,

       

      Its not a valid variable or function name

    • Anonymous's avatar
      Anonymous
      Not applicable

      ,DATE, in the given function should instead refer to the date column:

       

      expected_output= IF(YEAR(table[Date]) = YEAR(TODAY()),table[Date],BLANK())