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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Agne_J
Frequent Visitor

When adding 1 business day to Saturday and Sunday, gives Tuesday instead of Monday

Hello, 

 

I have tried creating calendar columns, where I have specific date and i want to have two additional columns, one to subtract 1 business day and another to add 1 business day. 

When creating a column with subtraction, everything seems well, however, when i add 1 business day it shows wrong date, i.e: 

 

what i did: 

 

1. I identified whether the day is workday:

 

Agne_J_0-1718116286280.png

2. I created ranking: 

 

Agne_J_1-1718116315286.png

3. Then I used this formula to add 1 business day:

 

Agne_J_3-1718116396030.png

 

 

You may see that if original date is Saturday or Sunday, it gives me Tuesday instead of Monday. 

 

Any ideas what i did wrong and how could i solve it?? I guess it has something to do with ranking,  i probably need Friday, Saturday and Sunday to have the same rank instead of Saturday, Sunday, Monday...Not sure how to achieve it!

 

 

1 ACCEPTED SOLUTION

@Agne_J OK, I would just create 1 column for like this then:

Add1WorkingDay Column =
  SWITCH( WEEKDAY( [Date], 2 ),
    5, [Date] + 3,
    6, [Date] + 2,
    [Date] + 1
  )


Minus1WorkingDay Column =
  SWITCH( WEEKDAY( [Date], 2 ),
    1, [Date] - 3,
    7, [Date] - 2,
    [Date] - 1
  )
   

 

Or use this fancy version I created a long time ago: Add Working Days - Microsoft Fabric Community

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@Agne_J Can you explain your logic of what you are trying to accomplish exactly? What should the results be and why?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler , 

 

The first column Date would be my actual date when shipment has arrived. Customer gives us "grace period" of +/- day, so i want to have two additional columns

1. Date + 1 business day

2. Date - 1 business day 

 

I hope this makes sense. 

@Agne_J OK, I would just create 1 column for like this then:

Add1WorkingDay Column =
  SWITCH( WEEKDAY( [Date], 2 ),
    5, [Date] + 3,
    6, [Date] + 2,
    [Date] + 1
  )


Minus1WorkingDay Column =
  SWITCH( WEEKDAY( [Date], 2 ),
    1, [Date] - 3,
    7, [Date] - 2,
    [Date] - 1
  )
   

 

Or use this fancy version I created a long time ago: Add Working Days - Microsoft Fabric Community

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler thank you so much!  I have no idea why i was trying to do it in such a difficult way when an easy one was in front of me....

 

Thank you for such a quick help!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.