Forum Discussion
Moller70
3 years agoFrequent 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 wa...
amitchandak
Super User
3 years agoMoller70 ,
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
Moller70
3 years agoFrequent Visitor
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])),