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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
TimmK
Helper IV
Helper IV

Add 3 Days to Today Excluding Weekend

How can I add 3 days to TODAY() skipping the weekend?

 

For example:

  • TODAY() = TUE 2022-12-13 + 3 days then the result should be FRI 2022-12-16
  • TODAY() = WED 2022-12-14 + 3 days then the result should be MON 2022-12-19 (instead of SAT 2022-12-17)
  • TODAY() = THU 2022-12-15 + 3 days then the result should be TUE 2022-12-20 (instead of SUN 2022-12-18)
  • TODAY() = FRI 2022-12-16 + 3 days then the result should be WED 2022-12-21 (instead of MON 2022-12-19)
2 ACCEPTED SOLUTIONS
TomasAndersson
Solution Sage
Solution Sage

Hi!
You can combine IF()/SWITCH() and WEEKDAY() (WEEKDAY function (DAX) - DAX | Microsoft Learn) for this. Something like:

Today + 3 = 
if(
    WEEKDAY( TODAY() + 3, 2) <= 2,  //If weekday Mon or Tue...
    TODAY() + 3,   //...add 3
    TODAY() + 5    //Else add 5
)

 Hope this helps!

View solution in original post

FreemanZ
Super User
Super User

hi @TimmK 

 

try to add a column with this:

DayPlus3 =
VAR _day = WEEKDAY([DATE],2)
RETURN
IF(
    _day>=1&&_day<=2,
    [DATE]+3,
    [DATE]+5
)
 
i tried and it worked like this:
FreemanZ_1-1671184892128.png

View solution in original post

3 REPLIES 3
FreemanZ
Super User
Super User

hi @TimmK 

 

try to add a column with this:

DayPlus3 =
VAR _day = WEEKDAY([DATE],2)
RETURN
IF(
    _day>=1&&_day<=2,
    [DATE]+3,
    [DATE]+5
)
 
i tried and it worked like this:
FreemanZ_1-1671184892128.png

Hola estimado, espero me pueda apoyar, utilice esta formula:

DayPlus3 =
VAR _day = WEEKDAY([DATE],2)
RETURN
IF(
_day>=1&&_day<=2,
[DATE]+3,
[DATE]+5
)

pero cuando la fecha cae en sabado o domigo me da una fecha incorrecta, por ejemplo:

 

tengo la fecha 29/04/2023 + 3 dias habiles la fecha correcta debe ser "03/05/2023 " pero a mi me da un dia de mas, me da la fecha 04/05/2023, me podria apoyar para saber donde esta el error.

TomasAndersson
Solution Sage
Solution Sage

Hi!
You can combine IF()/SWITCH() and WEEKDAY() (WEEKDAY function (DAX) - DAX | Microsoft Learn) for this. Something like:

Today + 3 = 
if(
    WEEKDAY( TODAY() + 3, 2) <= 2,  //If weekday Mon or Tue...
    TODAY() + 3,   //...add 3
    TODAY() + 5    //Else add 5
)

 Hope this helps!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors