cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EugenioJunior Frequent Visitor
Frequent Visitor

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 2
Super User
Super User

Re: How subtract 1 working day from date column

@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
 





Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





EugenioJunior Frequent Visitor
Frequent Visitor

Re: How subtract 1 working day from date column

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
))

 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 463 members 4,975 guests
Please welcome our newest community members: