Forum Discussion
How to remove seconds from time column?
How can I remove seconds from this time column? any help is greatly appreciated.
Hello imontoya14 ,
Here is an option:
=DateTime.From(Number.RoundDown(Number.From(DateTime.From([Time]))*(24*60/1))/(24*60/1))Also here is an article with explanation and other rounding options: How to categorize and group data in time intervals with Power Query .
Did I answer your question? Mark my post as a solution!
6 Replies
- ERDCommunity Champion
Hello imontoya14 ,
Here is an option:
=DateTime.From(Number.RoundDown(Number.From(DateTime.From([Time]))*(24*60/1))/(24*60/1))Also here is an article with explanation and other rounding options: How to categorize and group data in time intervals with Power Query .
Did I answer your question? Mark my post as a solution!
- selimovdMost Valuable Professional
Hey imontoya14 ,
add a new column with the DateTime.ToText function. With the second format parameter you can format it without seconds:
DateTime.ToText([DateTime], "yyyy/MM/dd hh:mm")Afterwards change the date type again to "Date/Time". Then you should have the values without seconds.
If you want to skip one step you can also directly convert it to date/time in the same step:
DateTime.FromText( DateTime.ToText( [DateTime], "yyyy/MM/dd hh:mm" ) )Let me know if that works for you. If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.bi- imontoya14Frequent Visitor
Hi there, thank you for your response. That worked but it looks like it created another problem. Upon creating the new column and completing the changes above. It switched my AMs to PMs and vise versa. How can I fix this so the format (AM/PM) does not change.
- imontoya14Frequent Visitor
any help is appreciated. Thank you.
- imontoya14Frequent Visitor
any help is appreciated. Thank you.