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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

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

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

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)

83.gif

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

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)

83.gif

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@Anonymous , In Data transformation you have the option to replace value try that or create a new column in dax like this

https://yodalearning.com/tutorials/learn-how-replace-values-power-query/

https://docs.microsoft.com/en-us/power-bi/desktop-shape-and-combine-data

 

DAX

New column= if(isblank([datetime]),now(),[datetime])

OR

New column= coalesce([datetime],now())

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
az38
Community Champion
Community 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]

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors