Forum Discussion
PowerZBI
8 months agoNew Member
Calculated days
I have 2 dates and want to calculate working times between those and I want to calculate working days in a month using it. I have relationship between my date table and main table. Please guide me on...
- 8 months ago
Please try the formula below:
Working Days in Month = CALCULATE ( COUNTROWS ( 'Date' ), WEEKDAY ( 'Date'[Date], 2 ) <= 5 ) - 8 months ago
Hi! PowerZBI
You can use something like this, if I understood your problem. Check putting this in matrix visualDays Count =
VAR WO_Start =
CALCULATE(
MIN('Table'[Date1]),
ALL('Calendar')
)VAR WO_End =
CALCULATE(
MAX('Labor Data'[Date2]),
ALL('Calendar')
)VAR StartDate = INT(WO_Start)
VAR EndDate = INT(WO_End)VAR _days =
COUNTROWS(
FILTER(
'Calendar',
'Calendar'[CALENDAR_DATE] >= StartDate &&
'Calendar'[CALENDAR_DATE] <= EndDate &&
)
)RETURN
_days
cengizhanarslan
8 months agoSuper User
Please try the formula below:
Working Days in Month =
CALCULATE (
COUNTROWS ( 'Date' ),
WEEKDAY ( 'Date'[Date], 2 ) <= 5
)