Forum Discussion
How to Remove Error in Date Field
- 8 years ago
If you are wanting to change all null values to a specific date (like 11/11/2011), then a simple replace values would work where you are replacing all null values with your ficticious date. You can also add a custom column with the following statement:
if [Your Date Column] = null then "11/11/2011" else [Your Date Column]
If you are trying to convert everything to a date and are receiving an error message, you can also try the following statement in a custom column (if your date column is currently text because of bad data):
try Date.FromText([Your Date Column]) otherwise (however you want the errors handled)
Could you send me an example of the error and the field causing the error. I am not sure I understand what you are trying to do with the field. If you are trying to write a formula to do something to a date but blank dates are throwing out errors, then use a try statement where you would write something like this:
try Date.FromText([Date]} otherwise (How you want to handle your error) This will basically try to do whatever you are wanting to do to the date field, and if it can't because it is blank, it will populate with whatever (null, "Text", etc.) But again, I might be misunderstanding your question. A screenshot would help if possible.
I want the column to be of type date/time. The empty entries in this case are marked as Error. I need a way to retain all of the information and cannot 'remove errors'. Besides replacing Error with a hardcoded date, what are my options?
- drewlewis158 years agoSolution Specialist
If the cells are empty, then it should be marking them as null instead of an error... Can you should me the data within the cells prior to the error along with the step that is causing the error?
- thoco8 years agoFrequent Visitor
The cells are blank, empty. When they are initially processed it is in a text format. I then convert it to date/time and get the erros on the blank dates.
- drewlewis158 years agoSolution Specialist
Do you have some sample data? I am not able to replicate your issue... When I try loading a table of dates into Power BI with blank cells within the table, I am not receiving an error when converting them to a date format. I might just be misunderstanding the issue...