Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Replace Null values with a current time stamp in datetime column

Hi Team,

i am new to power bi. i  ahve a data sets which holds DATETIME column which have some NULL values . which i want to replace with the current time stamp. please help

  • Anonymous's avatar
    Anonymous
    6 years ago

    HI Anonymous,

    I'd like to suggest you use replace value function to directly replace these null value to default value(you can't directly use power query function in the navigation pane), then you can use DateTime.LocalNow function to replace that static value to local DateTime.(replace value will auto changes when local datetime changes)

    Regards,

    Xiaoxin Sheng

3 Replies

  • az38's avatar
    az38
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    create a new column

    Column = IF(ISBLANK(Table[datetime]), NOW(), Table[datetime])

    or a custom column in power query editor

    = if [datetime] = null then DateTime.LocalNow() else [datetime]

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous,

    I'd like to suggest you use replace value function to directly replace these null value to default value(you can't directly use power query function in the navigation pane), then you can use DateTime.LocalNow function to replace that static value to local DateTime.(replace value will auto changes when local datetime changes)

    Regards,

    Xiaoxin Sheng