Forum Discussion
Replace (Blank) null values in DateTime Column with a String
- 2 years ago
Hi ElliotG ,
I'm uncertain whether it's feasible in Power BI to implement the suggested approach. Since the column currently has only a datatype for datetime, changing it to text might be a workaround, but it raises concerns about losing the benefits of time intelligence and date hierarchy that are provided by a DateTime column.
Thanks and Regards,
Sayali
Please mark the question solved when done and consider giving a thumbs up if posts are helpful!!
- Anonymous2 years ago
Hi ElliotG
To replace null or blank values in a DateTime column, you need to use a DateTime value consistent with the column rather than a string such as "Working".
This is because Power BI requires consistent data types within columns.
You can consider converting the column data type to text type and replacing the value in power query.
Proceed as follows:
Here is the original dummy data.
Enter power query and modify the data type.
replacement value.
Close & Apply.
If you want to adjust the order of the column, you can modify it in the visual.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
you can use the M code directly in the Power Query Editor. Here's an example of how to replace null or blank values in a DateTime column named "MyDateTimeColumn" with a specific DateTime value.