Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To include the hours component to a DateTime column using PowerQuery, you can follow these steps:

  1. Select the DateTime column in the Query Editor.

  2. Click on the "Add Column" tab, and select "Custom Column".

  3. In the formula bar, enter the following formula:

DateTime.LocalNow()

This will return the current date and time.

  1. Click on the "OK" button. This will add a new column to your table with the current date and time.

  2. Next, you can merge the two columns (DateTime and the new column) by selecting both, right-clicking and selecting "Merge Columns".

  3. In the "Merge Columns" dialog box, select the separator of your preference (e.g., comma, space, dash).

  4. Click on "OK". This will merge the two columns into one with the date and time in the format you selected.

  5. Finally, you can set the data type of the new column to DateTime by selecting the merged column, clicking on the "Data Type" button, and selecting "DateTime" from the dropdown menu.

Your DateTime column should now include the hours component.