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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
SteveMForm
Helper III
Helper III

How do I replace a null value in a date column?

Hi Folks

 

I have 2 date columns with some null values in, but it wont let me replace the null with text to say 'not specified' as it requires a date.

 

I don't want any other dates for these null values as I think it will throw graphics, any ideas?

4 REPLIES 4
Gabry
Super User
Super User

Can't you just exclude those nulls?

 

It doesn't make much sense to put not specified because "not specified" where will be shown in the graph?

 

You can put a date like 01/01/1900 and then filter out this date. 

Or you can make a measure that count this 01/01/1900 dates and says, there are x not specified dates

Hi @Gabry 

 

I dont want to exclude them- for example, I have one visual using this data as a Gantt which we show a line for the item, which I want for visibility, but the start and end date (the 2 date columns) being not filled (as not known yet) mean it has a line that is 1 single day of todays date, and I'm happy with that.

 

Any excluding, or replacing with a date then filtering out will remove the item, which I dont want

dufoq3
Super User
Super User

Hi, create new custom column

 

if [Date] = null then "not specified" else Date.ToText([Date], "yyyy-MM-dd") //you can specify any output in 2nd argument of Date.ToText function

 

 


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Hi @dufoq3 

 

so if I create a custom column (will be 2- one for start date and one for end date) and apply that Power Query Formula, will visuals like Gantt or any other visual which uses dates in conjunction with my dimDates table still pick up the date formats correctly? I suppose I can trial it...

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 Solution Authors