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

Skipping Weekends to check efficiency

Hi guys,

 

The scenario is I have Received Date (First Date) and Stock Date (Second Date), I need to check if the products we received on the First Date were put ready to stock in one day or less, for example: Received Date (First Date) June 23, 2021, the Stock date (Second Date) should at max June 24, 2021, if it exceed the one day period it is considered as a Fail. The issue I am facing is the weekend, if we receive the product on a Friday it is ok to have the product in stock on Monday, I could not replicate this on Power BI. Please see the Screeshot below, I tried to find what are the day of week and if its a weekend or not.

Ikezaki_0-1624477599769.png

 

Thank you in advance,

 

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi,  @Ikezaki 

You can try to add a calculated column as below:

 

 

Stock date = 
VAR adddays =
    SWITCH ( WEEKDAY ( 'Table'[First Date], 2 ), 5, 3, 6, 2, 7, 1, 1 ) // friday skip 3 days ,saturday skip 2 days,others skip 1 day 
RETURN
    'Table'[First Date] + adddays
Check = IF('Table'[Second Date]<='Table'[Stock date],"Successs","Fail")

 

 

Skipping Weekends to check efficiency.png

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi,  @Ikezaki 

You can try to add a calculated column as below:

 

 

Stock date = 
VAR adddays =
    SWITCH ( WEEKDAY ( 'Table'[First Date], 2 ), 5, 3, 6, 2, 7, 1, 1 ) // friday skip 3 days ,saturday skip 2 days,others skip 1 day 
RETURN
    'Table'[First Date] + adddays
Check = IF('Table'[Second Date]<='Table'[Stock date],"Successs","Fail")

 

 

Skipping Weekends to check efficiency.png

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

parry2k
Super User
Super User

@Ikezaki I have provided similar solution in other post (long time ago), see attached sample pbix file which skips the weekends, you can tweak the solution and use it as you see fit.

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.






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

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





Helpful resources

Announcements
May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!