cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors