Forum Discussion
How to Include "Time" in Date Hierarchy
From a design point of view I would have gone with 2 seperate tables, a date table and a seperate time table.
You will end up with the same result from a reporting point of view and your data model will be smaller and simplier.
Hi OpenDataLab,
I like your idea very much.
I would like to try your approach out.
Do you have the sript of for the Date Table and for the Time Table that can be shared?
I look forward to hearing from you.
Cheers,
MJC
- OpenDataLab9 years ago
Helper II
Here are links to a typical date dimension and time dimension:
In Power Query you will need to split your date time field into a date field and a time field you can use the parse function to do this:
- MJC19 years agoFrequent Visitor
Hi OpenDataLab,
I am now trying this option but I am having some problems.
I can load both power queries as per your script below. (just FYI I select the dates from 01/01/2017 to 31/12/2017)
Now I am having problems when I load my date. Essentially my CSV file has two columns. Column 1 Header is "Date" and contains dates of the following format 01/01/2017 and Column 2 Header is "XYZ" and contains numbers as this is my dataset. My data set starts at 01/01/2017 and finishes 24/07/2017 and moves on a 30 min time step. When I try to load my get i get a message sayin that there are problems with rows. Perhaps this has to do with the Parse thing you mentioned. I'd be greatful if you could clarify how I could solve this or consider the parse. I need a little more info than that on your figure. I am a real novice.
Could it also be because the dates on my data are for half year whereas the range i selected in the power query is for entire year.
Many thanks for your help in advance.
- OpenDataLab9 years ago
Helper II
Try this.
The other way to parse the data is to change the data type, but when you do this you need to specifiy the locale of the source data. One way to do this is to choose the "Using locale.." option on the change data type drop down of the column.
Once you select this option you will be presented with the following screen. Choose the options illustrated below.
Now Power Query nows what the format of your source data, it can interpret the data correctly and convert it.