cancel
Showing results for 
Search instead for 
Did you mean: 

Net Work Days

Super User
10066 Views
Tan Regular Visitor
Regular Visitor

Re: Net Work Days

Is there a way to calculate difference between Today() and a given date?

Super User
Super User

Re: Net Work Days

@Tan - Sure, you could do something like this:

 

NetWorkDays = 
VAR Calendar1 = CALENDAR(TODAY(),[Any Given Date])
VAR Calendar2 = ADDCOLUMNS(Calendar1,"WeekDay",WEEKDAY([Date],2))
RETURN COUNTX(FILTER(Calendar2,[WeekDay]<6),[Date])

If necessary, reverse the parameters for the CALENDAR function.


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


Tan Regular Visitor
Regular Visitor

Re: Net Work Days

Thanks @Greg_Deckler  this works like a charm.

Tan Regular Visitor
Regular Visitor

Re: Net Work Days

I now face another issue I also want to Exclude holdiays.   

 

I have created a "Holiday" table and also calculate working day  using

IsWorkingDay = IF (NOT(Dates[DayName]= "Saturday" || (Dates[DayName]= "Sunday")) && COUNTX(RELATEDTABLE(Holidays),1)<1,1,0)
 
How do I Exclude Holidays and Weekends to calculate working days from today() until given date 
 
TIA
 
 
Highlighted
NicoleBFeldman Frequent Visitor
Frequent Visitor

Re: Net Work Days

I am receiving the same error. Did you ever figure out the solution?

 

Thanks!

Tan Regular Visitor
Regular Visitor

Re: Net Work Days

I infact did i used Greg's solution and created another measure to calculate weekends and holidays and subtracted from the above solution.  


@NicoleBFeldman wrote:

I am receiving the same error. Did you ever figure out the solution?

 

Thanks!