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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

Calculate the % of absenteeism with a table of people end date and leave date of the company

GOOD DAYS TO ALL. I need your help because I am not able to get the data

I have a fact table where I have the hired staff with a column that has the start date of the contract and the end date of the contract.

In this formula I count the people I have for each month

Nº Workers = CALCULATE(COUNTx(FILTER('dmart dim_person','dmart dim_person'[employment_start_date]<=max(dFechas[Fecha]) && (ISBLANK('dmart dim_person'[employment_end_date]) || 'dmart dim_person'[employment_end_date]>max(dDates[Date]))),('dmart dim_person'[person_id])),CROSSFILTER('dmart dim_person'[employment_start_date],dDates[Date],None))

And then I have another fact table where I have the same people with a column, start date of their medical leave, and the date of discharge.

Hired Employee = CALCULATE(COUNT('fPersonalBaja'[person_id]),USERELATIONSHIP('fPersonalBaja'[Inicio_baja],dFechas[Fecha]))

The problem I am having is that when I have a person who has been on sick leave, for example, since February 2024 and to date is still on leave, the table shows me the sick leave in February, but then I go to March and it does not appear.

Olimpico1_5-1732442966188.png

What formula would you use to give me the result I want?, that is, that until I have a medical discharge date, this person continues to appear to me on the low.

Thanks a lot

Jose Luis

6 REPLIES 6
TomMartens
Super User
Super User

Hey,

 

Make sure that no login is required to download the sample file.
Unfortunately, I will be swamped until the upcoming weekend.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
TomMartens
Super User
Super User

Hey @Syndicate_Admin ,

 

please create a pbix file that contains sample data but still reflects your semantic model (talbes, relationships, calculated columns, and measures). Upload the pbix to OneDrive, Google Drive, or Dopbox and share the link. If you are using a psreadsheet to create the sample data instead of the manual import method, share the spreadsheet as well.

Describe the expected result based on the sample data you provide.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Adjunto link one drive

Test

Good morning

I don't know if he's going to let you see it, because this One Drive is for companies and they don't let us share things to the outside. If you can't see it, please provide me with your email address and I'll email it to you.

Thanks a lot

Jose Luis

Good afternoon

Have you been able to look at anything about the formulas I need?

Thanks a lot

Jose Luis

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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