Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Calculate working days using a date table

I have a working days table that identifies every date that is a working day, shown below:

 

 

What I want to do is create a measure that calculates difference in working days of Effective Date and Status Change Date, the two columns shown below

 

 

I tried the following code:

 

YourTable[DiffWorkingDays] =
CALCULATE(
    COUNTROWS ( 'Date'),
    DATESBETWEEN ( 'Date'[Date],  YourTable[Effective Date], YourTable[Status Change Date] – 1 ),
    'Date'[Working day] = 1,
    ALL ( 'Date' )
)

 

But unfortunately, it resulted in this error:

 

"The following syntax error occurred during parsing: Invalid token, Line 4, Offset 158, – "

 

Any ideas how to fix this code ?

 

I need to do the following:

 

  • Find the business/working days from one date column to another. 

1 Reply

  • Hi Anonymous ,

    Change the minus sign from "–" to "-".