Forum Discussion
Date format and table layouts
Just to clarify. When you say the YYYYMM is "actually the header of a column", do you mean that you have a table with multiple columns and each column will be its own YYYYMM value?
If thats the case, get the Query Editor to 'Unpivot' those columns such that it places them back into separate rows with only a single column. That should allow you to link those tables.
Using the YYYYMM format: An easy solution can be to create a formula column where you convert YYYYMM into dates making use of the LEFT and RIGHT along with the DATE function. This might look something like
= DATE(LEFT([OLDDATE], 4), RIGHT([OLDDATE], 2), 1)
which would change 201704 into a date of 1st April 2017.
Anonymous wrote:= DATE(LEFT([OLDDATE], 4), RIGHT([OLDDATE], 2), 1)
Is this supposed to work in PowerQuery (Excel) too?
- Anonymous7 years agoNot applicable
You can do something similar in Power Query. LEFT would be Text.Start. Right would be Text.End. Date isn't supported, however you can use Date.FromText to do something similar. I get the best results when i use Date.FromText and put the date data in a YYYY-MM-DD format first.