Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
VincentCeul
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
manikumar34
Solution Sage
Solution Sage

@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





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




I don not see where this helps my problem? 🙂

amitchandak
Super User
Super User

@VincentCeul , Try like

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

Any more ideas?  @amitchandak 

@VincentCeul , 

 

You are trying DAX in Power query. 

 

Please use the same DAX with Calculated column. 

 

Regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




@VincentCeul , That was DAX.

 

Try this on Power Query

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

VincentCeul_0-1602493738717.png

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

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.