programsam
Board Regular
- Joined
- Feb 10, 2016
- Messages
- 123
Greetings, a bit of a noob to PQ here.
I have a file that updates weekly and has the first day of every month in the header (screenshot below). I'd like to have Power Query parse the list of Column Names, look for the one's with dates in them and number them (starting from 12 all the way down to 1) since there's 12 months of data. The header names will change each month as a new month comes in and the old one falls off.
Sample of column header names.
Here's my attempt which is throwing a Token Literal Expected error with 'otherwise'.
I have a file that updates weekly and has the first day of every month in the header (screenshot below). I'd like to have Power Query parse the list of Column Names, look for the one's with dates in them and number them (starting from 12 all the way down to 1) since there's 12 months of data. The header names will change each month as a new month comes in and the old one falls off.
Sample of column header names.
Here's my attempt which is throwing a Token Literal Expected error with 'otherwise'.
VBA Code:
= Table.TransformColumnNames((#"Renamed Columns1"),each try Date.FromText(Table.ColumnNames((#"Renamed Columns1"){n}), otherwise _))