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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
sathish_kumar1
Frequent Visitor

Change time in Date Coulmn

Hi folks,

 I have a table with a column named Lead Creation Date that represents a Datetime. Format -> 13-12-2021  05:04:56 .

Now when Lead creation is less than 10:00:00 I want to replace the time 04:50:00 with 10:00:00 and if it is more than 18:00:00 it should also become 10:00:00.

The Lead Creation Date should look like 13-12-2021 10:00:00 now.

Basically, Time Range between 10 to 18 should remain the same and the rest should be replaced with 10:00:00.

 

It would be nice if someone can help me.

Thanks

 

Tiwari

 

 

1 ACCEPTED SOLUTION
tackytechtom
Most Valuable Professional
Most Valuable Professional

Hi @sathish_kumar1 ,

 

How about this:

tomfox_0-1645262335706.png

 

I used the following formular and changed the type of the new column to date/time afterwards:

TomsNewDateTimeColumn = 
IF ( 
    HOUR(Table[TomsDateTimeColumn]) < 10 || HOUR(Table[TomsDateTimeColumn]) > 18, 
    Table[TomsDateTimeColumn].[Date] & " " & TIME ( 10, 0, 0 ), 
    Table[TomsDateTimeColumn].[Date] & " " & TIME ( HOUR(Table[TomsDateTimeColumn]), MINUTE(Table[TomsDateTimeColumn]), SECOND(Table[TomsDateTimeColumn]) )
)

 

Does this solve your issue? 🙂

 

/Tom

https://www.tackytech.blog/

https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

1 REPLY 1
tackytechtom
Most Valuable Professional
Most Valuable Professional

Hi @sathish_kumar1 ,

 

How about this:

tomfox_0-1645262335706.png

 

I used the following formular and changed the type of the new column to date/time afterwards:

TomsNewDateTimeColumn = 
IF ( 
    HOUR(Table[TomsDateTimeColumn]) < 10 || HOUR(Table[TomsDateTimeColumn]) > 18, 
    Table[TomsDateTimeColumn].[Date] & " " & TIME ( 10, 0, 0 ), 
    Table[TomsDateTimeColumn].[Date] & " " & TIME ( HOUR(Table[TomsDateTimeColumn]), MINUTE(Table[TomsDateTimeColumn]), SECOND(Table[TomsDateTimeColumn]) )
)

 

Does this solve your issue? 🙂

 

/Tom

https://www.tackytech.blog/

https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.