Forum Discussion

DBATTIN's avatar
DBATTIN
Frequent Visitor
7 years ago
Solved

DATEDIFF Not Working in Custom Column

I am tyring to add the column as follows = Table.AddColumn(#"Added Custom", "OrderAge", each DATEDIFF ([DateTimeCreated],TODAY(),DAY))   But I get the meaasge    Expression.Error: The name 'DATE...
  • PattemManohar's avatar
    PattemManohar
    7 years ago

    DBATTIN I guess you have DateTimeCreated field as DateTime datatype which also needs to converted into Date type. So please try this...

     

    Duration.Days(Duration.From(DateTime.Date(DateTime.LocalNow())-DateTime.Date([DateTimeCreated])))