Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calculating # days absences

Hi all, 

 

I'm working on a formula to calculate the amount of working days that a person/people have been absense during a selected month. Unfortenately i cannot get it done yet, so hopefully somebody here can help me! 

 

The main tables I use are (At the moment i do not have a relation between these tables): 

Date table ; which has a column Isweekendday (true/false)  

Absense table ; with start and enddate of the absence.  Example:

Person x | Start date | enddate 

Person A |  09-01-2022 |  09-05-2022

 

Outcome should be if i select september 2022 : 3 days (as isweekendday is true for the 4rd and 4th of september) 

 

I already created a formula the amount of notifications, # = calculate(countrows(distinct('Absences '[ID])),filter('Absences ','Absences '[StartDate]<=max(DimDatum[Datum])&&'Absences '[EndDate]>=MAX(DimDatum[Datum])))+calculate(countrows(distinct('Absences '[EmpID])),filter('Absences ','Absences '[StartDate]<=max(DimDatum[Datum])&& ISBLANK('Absences '[EndDate].[Date]))), But not sure how i can create a similar formula for the amount of days between these dates.

 

Hope somebody can help me! Thanks in advance!

 

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , based on what I got, Please check networkdays can help. you can use a holiday calendar in that

https://amitchandak.medium.com/power-bi-dax-function-networkdays-5c8e4aca38c

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors