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
sannadisarath
New Member

difference between two days excluding weekends

Hi All,

 

How to i get difference between two dates excluding weekends, please let me know how should i do that.

2 REPLIES 2
AlexChen
Employee
Employee

Hi,

 

What does your “diffenence” mean?

 

If you want to calculate the days between 2 dates excluding weekends, I can give you a sample.

 

I assume you have a table called CntDays like screenshot below.

 

1.png

 

1. Add a custom column in query editor.

 

2.png

 

3.png

 

2. Expand the “Custom” column and convert it to date type.

 

4.png

 

3.  Calculate the “DayOfWeek” for “Custom” column.

 

5.png

 

4. Apply and close query editor. Add a new column to calculate weekdays.

 

Column = CALCULATE(COUNT(CntDays[DayOfWeek]), FILTER(all(CntDays), CntDays[DayOfWeek] <> 0 && CntDays[DayOfWeek] <> 6))

 

6.png

 

5. Now you can create a table visual to see count of days excluding weekdays.

 

7.png

 

Best Regards

Alex

 

Greg_Deckler
Super User
Super User

Use a Date table wihtout weekends?


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

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.