Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hi, I need a calucation to give me the work day of each month.
Do you have a formula that calculates business days, excluding weekends and holidays?
So, like this year 1/2/24 is working day 1. But I am looking for it to start over each month.
All the examples I have found are total working days for the year. I need for the month. And not total, meaning not 22 days in Jan. I need 1 – 22 detailed out for each month.
Jan 2 = 1
Jan 3 = 2
Jan 4 = 3,
Feb 1 = 1 , etc.
This is what I have right now, but is reserved.
= NETWORKDAYS('Date'[Start Date],'Date'[End Date])
This is results:
Jan 1 = 23
Jan 2 - 22, etc.
Any help ?
Thank you!
Solved! Go to Solution.
Don't waste your time . Use an external table. It's not necessary to calculate this over and over again.
Hi @yaya1974 ,
First use this DAX to add a new column:
Month = MONTH('Table'[Date])
Then please try this DAX to create a new column:
NETWORKDATS =
VAR MIN_DAY =
CALCULATE(
MIN('Table'[Date]),
FILTER(
'Table',
'Table'[Month] = EARLIER('Table'[Month])
)
)
VAR MAX_DAY =
CALCULATE(
MAX('Table'[Date]),
FILTER(
'Table',
'Table'[Date] <= EARLIER('Table'[Date]) && 'Table'[Month] = EARLIER('Table'[Month])
)
)
RETURN
NETWORKDAYS(MIN_DAY, MAX_DAY)
The final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @yaya1974 ,
First use this DAX to add a new column:
Month = MONTH('Table'[Date])
Then please try this DAX to create a new column:
NETWORKDATS =
VAR MIN_DAY =
CALCULATE(
MIN('Table'[Date]),
FILTER(
'Table',
'Table'[Month] = EARLIER('Table'[Month])
)
)
VAR MAX_DAY =
CALCULATE(
MAX('Table'[Date]),
FILTER(
'Table',
'Table'[Date] <= EARLIER('Table'[Date]) && 'Table'[Month] = EARLIER('Table'[Month])
)
)
RETURN
NETWORKDAYS(MIN_DAY, MAX_DAY)
The final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Don't waste your time . Use an external table. It's not necessary to calculate this over and over again.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 6 | |
| 5 |