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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rjs2
Resolver I
Resolver I

Change a date to the following Monday if it falls on a weekend

I am trying to evaluate a date field and change the date to the following Monday if it falls on a weekend.  I tried to use the WEEKDAY and DATEADD in an IF statement.  I keep getting :

 

"A Date Column containing duplicate dates was specified in a call o function 'DATEADD'.  This is not supported."

 

This is my statement:

Date Received = IF(WEEKDAY('Table'[DATE.FIELD],1)=1,Dateadd('Table'[DATE.FIELD],1,DAY))
 
I was going to do an embedend IF statement to calculate the Saturday and Sunday days to be the following monday, else use the date.
 
 
1 ACCEPTED SOLUTION
rjs2
Resolver I
Resolver I

solved it:

Created a weekday column then used this in a new column:

Date Received = If('Table'[Weekday]=7,'Table'[DATE]+2, If('Vetting Query'[Weekday]=1,'Table'[DATE]+1,'Table'[DATE]))

View solution in original post

1 REPLY 1
rjs2
Resolver I
Resolver I

solved it:

Created a weekday column then used this in a new column:

Date Received = If('Table'[Weekday]=7,'Table'[DATE]+2, If('Vetting Query'[Weekday]=1,'Table'[DATE]+1,'Table'[DATE]))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors