Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Adding Date excluding weekends for +10 days

DueDate =
VAR _P1 = Test274DateAddExcludeWeekends[CreatedDate] + TIME(2,0,0)
VAR _P2 = Test274DateAddExcludeWeekends[CreatedDate] + TIME(8,0,0)
VAR _P3 = Test274DateAddExcludeWeekends[CreatedDate] + 7
VAR _PreFinal1 = SWITCH(Test274DateAddExcludeWeekends[Priority],1,_P1,2,_P2)
VAR _PreFinal2 = SWITCH(WEEKDAY(_PreFinal1,2),6,_PreFinal1+2,7,_PreFinal1+1)
VAR _Final = IF(ISBLANK(_PreFinal2),_PreFinal1,_PreFinal2)
RETURN IF(Test274DateAddExcludeWeekends[Priority] IN {1,2},_Final,_P3)

 

@PattemManohar Once again thank you much for helping me out. If I change VAR_P2 to Test274DateAddExcludeWeekends[CreatedDate] + 10 to skip 10 days excluding weekends. The weekends are not getting excluded. Please help..

 

Actually the new requirement is for P4 and P5 which is 10 and 20 days. So I tried the same logic but not able to achieve it. Based on the created date I have to find the new Due Date excluding weekends. For P4 it should be P4 created date + 10 days excluding weekends.

 

Kindly help...

Previous post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

For your requirement, you could use the logic of your previous post which has been solved.

You could change the formula be like below.

VAR_P2=Test274DateAddExcludeWeekends[CreatedDate] + DAY(DATE(0,0,10))

Please have a try, if you still need help, please share your data sample which could reproduce your scenario and your desired output so that we could help further on it.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I dont see an option to attach files in this forum. Hence Pasted as screenshot. and data as table.

 

If you look at the below screenshot. the date for P3 calculation is set to P3 created date + 10 but the new date is not excluding weekends.

 

Capture1.PNG

 

 

IDModulePriorityCreatedResolvedDue Date
2Incident122/03/2019 14:0025/03/2019 16:00 
3Incident122/03/2019 23:0022/03/2019 15:00 
4Incident222/03/2019 14:00  
5Incident322/03/2019 14:00  
6Incident422/03/2019 14:00  
7Incident423/03/2019 14:00  
8Incident424/03/2019 14:00  
9Incident425/03/2019 14:00  
10Incident426/03/2019 14:00  
11Incident427/03/2019 14:00  
12Incident428/03/2019 14:00  
13Incident429/03/2019 14:00  
14Incident430/03/2019 14:00  
15Incident431/03/2019 14:00  
16Incident401/04/2019 14:00  
17Incident402/04/2019 14:00  
18Incident403/04/2019 14:00  
19Incident404/04/2019 14:00  
20Service Request122/03/2019 14:00  
21Service Request222/03/2019 14:00  
22Service Request322/03/2019 14:00  
23Service Request422/03/2019 14:00  
24Service Request326/03/2019 21:00  
25Incident522/03/2019 14:00  
26Incident622/03/2019 14:00  
27Incident722/03/2019 14:00  
28Incident822/03/2019 14:00  
29Incident922/03/2019 14:00  

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.