Hi Mynda,
I want to add a column in Power Query which gives the date of Today in every line (like in Excel =VANDAAG() . The formula must be dynamic.
Can you tell me how to do this?
Thx
That would be:
DateTime.LocalNow()
And then set the column data type to Date. That does what TODAY() does in Excel.
Hi Riny, Thanks for your answer. I made the following steps:
1. Add a custom column, which is a copy of a date column that was already there. I named the column DateTime. I changed the type of this column into date
2. Power Query automatically generates the following M-text
= Table.TransformColumnTypes(#"Aangepaste kolom toegevoegd",{{"DateTime", type date}})
3. Then I tried to change the text type date into type datetime.localnow
= Table.TransformColumnTypes(#"Aangepaste kolom toegevoegd",{{"DateTime", type DateTime.LocalNow}})
But unfortunately I get an error. What am I doing wrong?
In addition to my last answer:
My Power Query does not recognize the type DateTime.LocalNow (although it is shown when I start typing)
It does however recognize the type datetime (see underneath, this type is accepted, but it is not the type I want.
= Table.AddColumn(#"Type gewijzigd", "Vandaag", each [Datum], type datetime)
The error = Type ID is not valid
Hi Antonia,
Try just using the data type drop down on the column to apply the Date Time data type. This should apply it using the nomenclature for your locale.
Mynda