Forum Discussion
Anonymous
7 years agoNot applicable
A M-Code equivalent for =NETWORKDAYS() in excel?
So I have a start and an end date and I need to calculate turnaround time in working days. Excel has NETWORKDAYS which does the removing of weekends all by itself. Is there an equivalent for M-C...
- 7 years ago
You would invoke it in your original table as Add Columns->Invoke Custom Function. Set each argument as column and use your start date column and end date column.
Edit: Or alternately use it in Advanced Editor, and pass on Start & End as variable (from calculation, another query etc).
Oh, custom function should be copied and pasted into new blank query (using advanced editor). Name it something that makes sense. (Ex: fnWorkday).
damonsmithies
7 years agoRegular Visitor
Could you not create a custom dates table and denote when a date is a weekend and when it is a weekday?
See BhaveshPatel solution here: https://community.powerbi.com/t5/Desktop/Date-Duration-exclude-weekends/td-p/87735