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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
julesdude
Post Partisan
Post Partisan

Cannot Convert the Value #date(2027, 3, 31) to type Text Error in Custom Column

Hi all,

 

I have a custom column with the following formula:

 

if Text.Length([Option Effective Date]) = null then Date.AddMonths([Option Start Date], [Notice Period]) else [Option Effective Date]

 

I am trying to apply logic that says that is the [Option Effective Date] column doesn't have a date in it (it either does or just reads 'null') then take the date from column [Option Start Date] and advance the months by the number in column [Notice Period].

 

Else just use the date in the [Option Effective Date] column.

 

Dates are pulled through when the condition is true. However I get error in cells with the above error message for the Else logic. 

What am I doing wrong?

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

In your case, Text.Length is not required. Hence, this would be enough.

= if [Option Effective Date] = null then Date.AddMonths([Option Start Date], [Notice Period]) else [Option Effective Date]

If you want to test for the presence of a date field

= if Value.Is(Date.From([Option Effective Date]), type date) then Date.AddMonths([Option Start Date], [Notice Period]) else [Option Effective Date]

View solution in original post

1 REPLY 1
Vijay_A_Verma
Super User
Super User

In your case, Text.Length is not required. Hence, this would be enough.

= if [Option Effective Date] = null then Date.AddMonths([Option Start Date], [Notice Period]) else [Option Effective Date]

If you want to test for the presence of a date field

= if Value.Is(Date.From([Option Effective Date]), type date) then Date.AddMonths([Option Start Date], [Notice Period]) else [Option Effective Date]

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors