cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

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 7
Super User IV
Super User IV

@VincentCeul , Try like

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

VincentCeul_0-1602493738717.png

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

 

Solution Specialist
Solution Specialist

@VincentCeul 

 

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

 

https://docs.microsoft.com/en-us/dax/date-function-dax

 

Refre the above link to learn about DATE function

 

Regards, 

Manikumar

I don not see where this helps my problem? 🙂

Any more ideas?  @amitchandak 

@VincentCeul , That was DAX.

 

Try this on Power Query

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

@VincentCeul , 

 

You are trying DAX in Power query. 

 

Please use the same DAX with Calculated column. 

 

Regards, 

Manikumar

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors