Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
A simple DATEDIFF function would allow me to subtract the two... But I have no idea how to check each one if it's a working day.
Solved! Go to Solution.
Hi @Anonymous ,
In case you are looking for a Calculated Column you can refer to this method.
YourTable[DiffWorkingDays] =
CALCULATE(
COUNTROWS ( 'Date'),
DATESBETWEEN ( 'Date'[Date], YourTable[Effective Date], YourTable[Status Change Date] - 1 ),
'Date'[Working day] = 1,
ALL ( 'Date' )
)
Hi @Anonymous ,
Did you copy or type the code?
Make sure your minus sign is "-" and not "–". This could be the issue here.
Hi @Anonymous ,
In case you are looking for a Calculated Column you can refer to this method.
YourTable[DiffWorkingDays] =
CALCULATE(
COUNTROWS ( 'Date'),
DATESBETWEEN ( 'Date'[Date], YourTable[Effective Date], YourTable[Status Change Date] - 1 ),
'Date'[Working day] = 1,
ALL ( 'Date' )
)
Hi @Payeras_BI -- this results in error:
The following syntax error occurred during parsing: Invalid token, Line 4, Offset 158, –
The subtraction seems to be breaking it
Slicer on date where you select the date range
Then sum of the column working days
User | Count |
---|---|
77 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
100 | |
93 | |
52 | |
50 | |
48 |