Forum Discussion
How to combine Date Hour in power query
- 2 years ago
in Power BI, you can add a new column:
Date-hr = Time(hour([Column1]),0,0) + Int([Column1]) - 2 years ago
Good day arsm,
Power Query provides a function Time.StartOfHour, for example if your datetime column is called "DateTime" and your previous steps is called "Previous Step", this code will transform the column to give the start of the hour and retain the type as datetime.
= Table.TransformColumns(#"Previous Step",{{"DateTime", Time.StartOfHour, type datetime}})This transformation is available via the GUI on the "Transform" tab, "Date & Time Column" area and "Time", "Hour", "Start of Hour".
Hope this helps
Good day arsm,
Power Query provides a function Time.StartOfHour, for example if your datetime column is called "DateTime" and your previous steps is called "Previous Step", this code will transform the column to give the start of the hour and retain the type as datetime.
= Table.TransformColumns(#"Previous Step",{{"DateTime", Time.StartOfHour, type datetime}})
This transformation is available via the GUI on the "Transform" tab, "Date & Time Column" area and "Time", "Hour", "Start of Hour".
Hope this helps
- arsm2 years agoFrequent Visitor
Thank you collinsg