Forum Discussion
dateadd function today minus period
- 9 years ago
Table.Addcolumn needs a table parameter where you want to add the column. In my case the table is called '"Changed Type" which is the name of my last transformation step before Table.AddColumn.
Your approach was just by using the button "custom column" So there you just write
if [EndDate]<Date.AddMonths(Date.From(DateTime.LocalNow()),-3) then 1 else 0)
The rest will be added by Query Editor itself.
- 9 years ago
So when you click on the word error he will show you some details about it.
However
You say that your date column is in datetime format? Could you please write Date.From([lastLD]) instead of [lastLD]
Brackets are ok as far as i see
okay, help me out a little bit.
Where do I put this power query?
I'm in the Query editor, under Add Column I see different types.
Do I need a Custom Column or Conditional Column? Or something else?
The query itself is clear to me.
custom column
all other options are in fact custom columns as well. But they help you to get your wishes without writing code.
(conditional e.g. is the click variant of if then else)
- WillemC9 years agoResolver I
Thank you.
Just one small question, what does the #"Changed Type" mean?
Since it's throwing me an error.
Quick Google search didn't give me an answer right away.
edit:
seems that's the table name on which you want to add the column.
- spuder9 years agoResolver IV
Table.Addcolumn needs a table parameter where you want to add the column. In my case the table is called '"Changed Type" which is the name of my last transformation step before Table.AddColumn.
Your approach was just by using the button "custom column" So there you just write
if [EndDate]<Date.AddMonths(Date.From(DateTime.LocalNow()),-3) then 1 else 0)
The rest will be added by Query Editor itself.
- WillemC9 years agoResolver I
still not working
I've altered it to:
= if [lastLD]>Date.AddMonths(Date.From(DateTime.LocalNow()),-3) then 1 else 0
The column gets created but only contains Error.
If I add an ) on the end, I get a Token Eof expected error, which seems valid to me, since that one doesn't belong to anything.
de lastLD is formatted in d-m-yyyy h:mm:ss
- WillemC9 years agoResolver I
The expression is giving me the following error:
Expression.Error: Evaluation resulted in a stack overflow and cannot continue.