Forum Discussion

alawode's avatar
alawode
Helper I
5 years ago
Solved

Less than from todays date

Hi Experts,

I am trying to calculate Project end date status based on the days between "todays date" and the amount of days between the "project end date".

For example, if its equal to  or less than 30 days "Expires in One Month". If its equal to or less than 90 days "Expires in 90 days", and if its equals to or less than 180 days "Expires in 6 months" Any help on how to create this calculated column will be appreciated.

Thanks in advance

  • Anonymous's avatar
    Anonymous
    5 years ago

    Say your table or last step name is Table1. Add a new step named DaysCalc, and in the formula bar, type:


    = Table.AddColumn(Table1, "Days", each [project end date] -Date.From(DateTime.LocalNow()))

     

    Then

    = Table.AddColumn(DaysCalc, "Status", each if [Days] < 31 then "Expires In One Month" else if [Days] < 91 then "Expires In 90 Days" else "Expires in 6 Months")

     

    --Nate

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Say your table or last step name is Table1. Add a new step named DaysCalc, and in the formula bar, type:


    = Table.AddColumn(Table1, "Days", each [project end date] -Date.From(DateTime.LocalNow()))

     

    Then

    = Table.AddColumn(DaysCalc, "Status", each if [Days] < 31 then "Expires In One Month" else if [Days] < 91 then "Expires In 90 Days" else "Expires in 6 Months")

     

    --Nate