Forum Discussion
Create a date from distinct day, month & year columns
- 4 years ago
NewStep=Table.AddColumn(PreviousStepName,"Date",each #date([YEAR],[MONTH],[DAY]))
- 4 years ago
The M language uses this notation for certain literals like #time, #date, #duration, #binary, #table.
See here for the syntax of all of the value kinds:
https://docs.microsoft.com/en-us/powerquery-m/m-spec-valuesNote that #date is not a function at all. It's a value.
NewStep=Table.AddColumn(PreviousStepName,"Date",each #date([YEAR],[MONTH],[DAY]))
- Gdibbs4 years ago
Helper I
wdx223_Daniel Thank you. This worked. I believe I tried this before which did not work, but with one missing character you used. I did not use "#" before date. Why is "#" being used before date? If you don't mind providing a simple explanation it would be greatly appreciated. Just for my education and background - and for others who may benefit.
- AlexisOlson4 years ago
Super User
The M language uses this notation for certain literals like #time, #date, #duration, #binary, #table.
See here for the syntax of all of the value kinds:
https://docs.microsoft.com/en-us/powerquery-m/m-spec-valuesNote that #date is not a function at all. It's a value.
- Anonymous4 years agoNot applicable
I understand the solution provided but I have a day of year instead of just day. In DAX, there is a calculated column which uses Day() to convert this to a day to use in a DAX formula to create a date but I want to do this in Power Query. How do I amend the Power query formula for this?