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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
rogerdea
Helper IV
Helper IV

Measure time in days excluding weekends

I have a measure which counts the number of days between two dates using the DATEDIFF funtion and that's fine.  However, as this is a business related measure, i need to exclude weekends.

 

So Friday to Monday should be calculated as 1 day.

 

Any ideas if this is possible?

Thanks

4 REPLIES 4
Anonymous
Not applicable

Create a proper Dates table and then you'll be able to do this:

 

[# Working Days] =
CALCULATE(
	COUNTROWS( Dates ),
	KEEPFILTERS( Dates[Working Day] = TRUE() )
)

Best

Darek

Thanks for the reply.  I now have this calculation in my date table, but how do i use this to measure working days from a date in my other data table?  Sorry if i have misunderstoof Darek.

Anonymous
Not applicable

Very easy in fact...

 

If you have 2 dates D1 and D2, then the number of working days between them is this:

 

var __dateStart = D1 -- your start date 
var _dateEnd = D2 -- your end date
var __workingDays =
	calculate(
		[# Working Days],
		Dates[Date] >= D1,
		Dates[Date] <= D2
		ALL( Dates )
	)
return
	__workingDays

Best

Darek

HotChilli
Super User
Super User

You need the equivalent to Excel's NETWORKDAYS

 

https://www.sqlbi.com/articles/counting-working-days-in-dax/

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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