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
Abduvali
Skilled Sharer
Skilled Sharer

Calculate Number of Days between 2 dates excluding weekends

Hi All,

 

 

I'm trying to calculate a number of days between two dates without weekends:

  • I have Order Date and a Shipment Date
  • I have created Calendar table to use the following approach: 

Capture56.PNG

But I'm not getting any results back my new TAD column is blank =o?

Capture57.PNG

 

Here is my dax formula i'm using: 

I have created a new column in Dates table:

  • IsWorkDay = SWITCH(WEEKDAY('Date'[Date],2),6,0,7,0,1)

Then I'm creating a new TAD column to get number of days excluding weekends:

  • TAD = CALCULATE(SUM('Date'[IsWorkDay]),
                DATESBETWEEN('Date'[Date],'Master Sheet'[Ord Date],'Master Sheet'[Ship Date]))

 

Am I doing something Wrong here???

 

 

Thank you.

 

Regards

Abduvali

 

 

2 ACCEPTED SOLUTIONS
Abduvali
Skilled Sharer
Skilled Sharer

Hi All,

 

It's actually was a bug after restarting Power BI its solved itself =oD

 

 

Regards

Abduvali

View solution in original post

v-yulgu-msft
Employee
Employee

Hi @Abduvali,

 

Glad to hear that you have solved this problem. Would you please mark your sharing resolution as an answer so that it might help more users?

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

4 REPLIES 4
BigKev
Helper III
Helper III

Hey Abdulvali,

 

When I used your TAD formula, it returns me with an error saying that a single value for column Due Date cannot be determined

BigKev_0-1614942892267.png

 

This is my data structure

BigKev_1-1614942967656.png

 

Do you know what I did wrong here?

 

Cheers,

Kev

 

Cheers,

Kev

ssvr
Helper III
Helper III

after applying your steps i got wrong output

 

Please help me outDdiff_room.JPG

 

 

v-yulgu-msft
Employee
Employee

Hi @Abduvali,

 

Glad to hear that you have solved this problem. Would you please mark your sharing resolution as an answer so that it might help more users?

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Abduvali
Skilled Sharer
Skilled Sharer

Hi All,

 

It's actually was a bug after restarting Power BI its solved itself =oD

 

 

Regards

Abduvali

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.