cancel
Showing results for 
Search instead for 
Did you mean: 
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

@acannon , refer to 2nd page(working day diff) -https://www.dropbox.com/s/y47ah38sr157l7t/Order_delivery_date_diff.pbix?dl=0

 

If that can help .

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors