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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
TonyHansson
Frequent Visitor

Change date and time

Hi

 

I have a column with a date and time.

 

I need to keep the date, but change the time to always be 15:00

 

I have tried different but no luck.

 

Custom column = Date.From([#"Column"]) + #duration(0,15,0,0)

 

Regards

 

Tony

 

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

You could try constructing a datetime and hardcoding the time .

Here's a start:

#datetime(Date.Year([Column1]), Date.Month([Column1].....

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

You could also use DateTime.ToText and DateTime.FromText like this:

DateTime.FromText(DateTime.ToText([Column], [Format="yyyy-MM-dd 15:00:00"]))

 

TonyHansson
Frequent Visitor

Hi @HotChilli 

 

Worked perfect Thank you

 

#datetime(Date.Year([#"M&P deadline"]),Date.Month([#"M&P deadline"]),Date.Day([#"M&P deadline"]),15,00,00)

HotChilli
Super User
Super User

You could try constructing a datetime and hardcoding the time .

Here's a start:

#datetime(Date.Year([Column1]), Date.Month([Column1].....

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors