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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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