Forum Discussion

ANB_13's avatar
ANB_13
Helper I
3 years ago
Solved

Create a new conditional column with difference of dates

Hello everyone, 

 

I want to create a new conditional date :  i have a column XXX with date (with some empty fields) and i want to create a new column with conditions : 

  • If the difference between column XXX and the day of today (30/05/2023 today, 31/05/2023 tomorrow etc) is between 0 and 60 days, so the output is "A
  • If the difference between column XXX and the day of today (30/05/2023 today, 31/05/2023 tomorrow etc) is between 60 and 90 days, so the output is "B"
  • If the difference between column XXX and the day of today (30/05/2023 today, 31/05/2023 tomorrow etc) is plus than 90 days, so the output is "C"

How can i create this column ?

 

Thank you very much 

Regards

  • Hi ANB_13,

    Check at image bellow the Power Query function how to create a new collumn as you wish. The trick here is know how to use Duration.Days() function.

     


    If you think it is solved your problem, please, consider to mark it as solution.

    Regards

1 Reply

  • Hi ANB_13,

    Check at image bellow the Power Query function how to create a new collumn as you wish. The trick here is know how to use Duration.Days() function.

     


    If you think it is solved your problem, please, consider to mark it as solution.

    Regards