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

Calculate total working dates

Hi.

I have a tabel "Start Stop" where i have start and end dates for each employee. Same employee can start and stop more times.

 

I have a date tabel and a employee tabel with relations.

 

I want to calculate the total working days for a month and want to calculate the working days under considiration of start and end date and a slicser, where i filter on dates.

 

Can anyone help?

 
3 REPLIES 3
aditya0125
Resolver I
Resolver I

Working_Days= var max = Maxx(Allselected(Date), Date[Date])

                          var min = Minx(allselected(Date), Date[Date]) 

return

                          Networkdays(max(min ,[Start Date]), Max(max, [End Date]),1)

amitchandak
Super User
Super User

@Moller70 ,

Tray a measure like

 

Working days

var _max = maxx(allselected(Date), Date[Date])

var _min = Minx(allselected(Date), Date[Date]) 

return

NETWORKDAYS(max(_min ,[Start Date]), Max(_max, [Stop Date]),1)

 

Business day with and without using DAX Function NETWORKDAYS: https://www.youtube.com/watch?v=Qs03ZZXXE_c

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi and thank you for your reply.
I have made this formula:

XYC working days 2 =
var _max = maxx(Kalender,Kalender[Date])
var _min = minx(Kalender,Kalender[Date])
return
NETWORKDAYS(max(_min,'XYC Employee Start Stop'[Start Date]),max(_max,'XYC Employee Start Stop'[Stop Date]),1)
 
But it is writing the error message: "A single value for column 'Start Date' in tabel 'XYC Employee Start Stop' cannot be determined.
 
If I make a simpel If statment, I cannot sellect the 'XYC Employee Start Stop'[Start Date]. Why that?
 
I only want the measure to calculate the number of working days for the employees that acutally is employed in the periode.
 
So I need somthing like this:
If(And(XYC Employee Start Stop'[Start Date])<= STARTOFMONTH(Kalender[Date]),'XYC Employee Start Stop'[Start Date])>= STARTOFMONTH(Kalender[Date])),
 

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.