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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
Microsoft Employee
Microsoft 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
Community Champion
Community Champion

Use a Date table wihtout weekends?



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.