Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi
I'm trying to calculate the number of workforce absent days per month based on a start and end date and which takes into account absence spanning across a number of months.
I've come across the following code which is working perfectly for the number of calendar days, however, i would like to discount weekends and struggling on how to do it?
Any help greatly appreciated!
You can use the NETWORKDAYS function for that. Assuming the In date is when the person returns, here is an example measure.
Pat
Thanks Pat, but this doesn't work for people with an open ended absence. i.e. some people haven't returned to work yet and have a blank entry in the Absence end date.
I also want to show the the number of absences per month in a simple line chart by month and your measure just gives me a constant line
Please try this version that uses TODAY() for any rows w/o a return date yet.
WorkDaysOut2 =
SUMX (
T7,
VAR maxdate =
COALESCE ( T7[In], TODAY () )
RETURN
NETWORKDAYS ( T7[Out], maxdate - 1 )
)
Pat
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |