cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sweta254
New Member

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 @sweta254,

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 @sweta254,

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

amitchandak
Super User IV
Super User IV

@sweta254 , 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())

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

az38
Super User II
Super User II

Hi @sweta254 

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
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors