Forum Discussion

EugenioJunior's avatar
EugenioJunior
Frequent Visitor
7 years ago

How subtract 1 working day from date column

Hi,

 

I have a date column [date of birth] and need to subtract a variable number of working days from that data.

How can I do this?

 

If the date field is not working day, then I need to advance this date to the most working day before the date given in the column.

2 Replies

  • EugenioJunior you can simply substract

    new date = Table[Date of Birth] - <value you want to subtract>

    and you can check if new date Date of week is Sat or Sunday, add # of days accordingly

     

    Spoiler
     
    • EugenioJunior's avatar
      EugenioJunior
      Frequent Visitor

      Hi, parry2k 

      Thanks for the feedback. I need to remove holidays. How can I make this work?



      Data_Aniversario_UTIL =
      IF(WEEKDAY(LiberacaoAgenda[Data_aniversario],2) = 6,LiberacaoAgenda[Data_aniversario]-1, --Saturday
      IF(WEEKDAY(LiberacaoAgenda[Data_aniversario],2) = 7,LiberacaoAgenda[Data_aniversario]-2 --Sunday
      ))