Forum Discussion

WillemC's avatar
WillemC
Resolver I
9 years ago
Solved

dateadd function today minus period

Hi all,   I'm new to Power BI, but know my way around in SQL. I'm trying to create a calculated column / measure with an if statement. What I want to achieve is this:   if maxdate is larger tha...
  • spuder's avatar
    spuder
    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. 

  • spuder's avatar
    spuder
    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