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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
acannon
New Member

Negative Net Work Days

Good afternoon! 

I'm trying to calculate net work days for my company. I was using a DAX syntax to calculate it, however we do accept NEGATIVE networkdays at our office and the DAX is rejecting the negative numbers. Does anyone have a solution to calculate a networkdays difference that will allow me to have negative? 

This was the dax formula I was using 

""NetWorkDays =
(Var TBL_Date=CALENDAR('COMPLETED (2)'[BATCH DATE],'COMPLETED (2)'[COMPLETED DATE])

vAR TBL_FinalDate=
ADDCOLUMNS(TBL_date,
"WorkingDay",if(weekday([Date],2)>=6,0,1),
"Holiday",iferror(lookupvalue('MY COMPANY CALENDAR'[Holiday Count],'MY COMPANY CALENDAR'[Holiday Date],[Date]),0)
)
Return
sumx(tbl_finalDate, if([WorkingDay]=1 && [Holiday]=0, 1, 0))""

The error I got was " The start date in Calendar function can not be later than the end date"


1 REPLY 1
amitchandak
Super User
Super User

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors