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
vyny17
Frequent Visitor

How to add n business days to date using DAX

Hi there!

 

Here is the thing, i have a table with a date column and I want to create a new column adding 5 or 7 business days  to it, depending on some conditions.

I've also heard that there's this "new" function NETWORKDAYS( ), i thought I could use it somehow but it doesn't seem to solve my problem.

 

What can I do? 😄 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@vyny17 

maybe you can try this

5 businessday = if('Table'[Column]=6,'Table'[Date]+6,if('Table'[Column]=7,'Table'[Date]+5,'Table'[Date]+7))
 
7 businessday = if('Table'[Column] in {1,2,3},'Table'[Date]+9, if('Table'[Column]in {4,5},'Table'[Date]+11,if('Table'[Column]=6,'Table'[Date]+10,if('Table'[Column]=7,'Table'[Date]+9))))
 
1.PNG
pls see the attachment below




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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
vyny17
Frequent Visitor

Thx bro! You saved me!!

you are welcome





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

Proud to be a Super User!




ryan_mayu
Super User
Super User

@vyny17 

maybe you can try this

5 businessday = if('Table'[Column]=6,'Table'[Date]+6,if('Table'[Column]=7,'Table'[Date]+5,'Table'[Date]+7))
 
7 businessday = if('Table'[Column] in {1,2,3},'Table'[Date]+9, if('Table'[Column]in {4,5},'Table'[Date]+11,if('Table'[Column]=6,'Table'[Date]+10,if('Table'[Column]=7,'Table'[Date]+9))))
 
1.PNG
pls see the attachment below




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

Proud to be a Super User!




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.