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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

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

@Anonymous 

 

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!




Anonymous
Not applicable

I don not see where this helps my problem? 🙂

amitchandak
Super User
Super User

@Anonymous , Try like

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Any more ideas?  @amitchandak 

@Anonymous , 

 

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!




@Anonymous , That was DAX.

 

Try this on Power Query

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

VincentCeul_0-1602493738717.png

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

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.