Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

IF formula for Custom Column error

My goal is to replace empty date values in a table to a custom date value (31/12/9999 e.g.) by adding a new column where I use an IF function.

 

The new column should be composed out of '31/12/9999' is the value in column X is blank, while if the value in column X is not blank, the column should take the value that is in column X.

 

The custom column formula I use is IF ( ISBLANK ([Date Finished]) , ("31/12/9999"), [Date Finished]), but I receive the error: Expression.Error: The name 'IF' wasn't recognized. Make sure it's spelled correctly.

7 Replies

  • Anonymous , Try like

    IF ( ISBLANK ([Date Finished]) , date(9999,12,31), [Date Finished])

    • Anonymous's avatar
      Anonymous
      Not applicable

      Dear, I still receive the same error. If something wrong with my settings?

       

      • amitchandak's avatar
        amitchandak
        Super User

        Anonymous , That was DAX.

         

        Try this on Power Query

        if [Date Finished] =null then Date.FromText("9999-12-31") else [Date Finished]

    • Anonymous's avatar
      Anonymous
      Not applicable

      I don not see where this helps my problem? 🙂