Forum Discussion
Dynamic networkdays function in measure
- 3 years ago
I used a workaround by using countrows on my data table and filtering out weekends. SUMX then calculated it by item and totalled the answer
TheEdwardFancy You'll have to get the MIN start date and MAX end date and then calculate the number of working days, something like:
Measure =
VAR __Min = MIN('Table'[Start Date])
VAR __Max = MAX('Table'[End Date])
VAR __Result = NETWORKDAYS(__Min, __Max)
RETURN
__Result
You may also need to combine this with something like Time Intervals:
Take a look at these two Quick Measures as I think you want something like them.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364
https://community.powerbi.com/t5/Quick-Measures-Gallery/Periodic-Billing/m-p/409365
Not sure what your current calculation looks like.
I used a workaround by using countrows on my data table and filtering out weekends. SUMX then calculated it by item and totalled the answer