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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Sri_phani
Helper III
Helper III

Date column + Time Column

Hi, 

 

I have a Date column and another column which has End time in Whole number. I want to combine both so that I get DateTime format (DD/MM/YYYY HH:MM:SS AM/PM). 

Sample Data: 

Sri_phani_1-1731606723853.png

Expected data: 

I am doing this in excel by dividing End column/86400 and then combining using text function.

 

Sri_phani_2-1731606803153.png

 

Do we have a way of doing it in Power Query?

 

 

1 ACCEPTED SOLUTION
ronrsnfld
Super User
Super User

The entry in your first row makes no sense. If your time component represents Seconds, the time component of the first row is over ten days, yet your expected data shows the result to be on the same day.

 

If you really want to ignore multiple days in the End column, then you can use in your custom column formula:

 

=DateTime.From(Number.From([Date]) + Number.Mod([End],86400)/86400)

 

 

If you really want to keep the dates where End implies more than one day, then remove the Number.Mod function:

 

=DateTime.From(Number.From([Date]) +[End]/86400)

 

Also, note that, unlike Excel, you cannot specify a particular format for a Date column in Power Query (You can in a Power BI visual). In Power Query, the appearance will be that specified in your computer Windows Regional Settings.

If you really require the format to be as you show in your Excel expected output example, you may need to convert it to a text string. Of course, if you do that, date-related math operations will be much more difficult.

 

Here's an example:

 

=DateTime.ToText(DateTime.From(Number.From([Date]) +[End]/86400), "dd/MM/yyyy hh:mm tt")

 

ronrsnfld_0-1731612380475.png

 

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Sri_phani ,

Thanks for all the replies!
Please check these replies to see if there is a solution you are looking for. If a user's reply can help you, please don't forget to accept its reply as solution so that other users can find the solution faster, thank you!

Best Regards,
Dino Tao

Omid_Motamedise
Super User
Super User

Hi @Sri_phani 

 

Use the following formula

 

 

Date.From([Date])&Time.From(Number.From([End])/(24*60*60))
If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h
ronrsnfld
Super User
Super User

The entry in your first row makes no sense. If your time component represents Seconds, the time component of the first row is over ten days, yet your expected data shows the result to be on the same day.

 

If you really want to ignore multiple days in the End column, then you can use in your custom column formula:

 

=DateTime.From(Number.From([Date]) + Number.Mod([End],86400)/86400)

 

 

If you really want to keep the dates where End implies more than one day, then remove the Number.Mod function:

 

=DateTime.From(Number.From([Date]) +[End]/86400)

 

Also, note that, unlike Excel, you cannot specify a particular format for a Date column in Power Query (You can in a Power BI visual). In Power Query, the appearance will be that specified in your computer Windows Regional Settings.

If you really require the format to be as you show in your Excel expected output example, you may need to convert it to a text string. Of course, if you do that, date-related math operations will be much more difficult.

 

Here's an example:

 

=DateTime.ToText(DateTime.From(Number.From([Date]) +[End]/86400), "dd/MM/yyyy hh:mm tt")

 

ronrsnfld_0-1731612380475.png

 

 

Anonymous
Not applicable

In your custom column formula, write

 

= Date&Time.From([End]/86400)

 

--Nate

@Anonymous I am getting error when I use division method. Some of the values are creating error. Example like this, when converting 932852 into date/time format

 

 

Sri_phani_0-1731607931415.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors