Forum Discussion

ElliotG's avatar
ElliotG
Frequent Visitor
2 years ago
Solved

Replace (Blank) null values in DateTime Column with a String

Is it possible to replace null/(Blank) row values in a DateTime Column?  I have tried using a power query find and replace but it says it has to be replaced with a DateTime value.  I understand that ...
  • sayaliredij's avatar
    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!! 

  • Anonymous's avatar
    Anonymous
    2 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.