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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
NPEQ
New Member

Issues with filtering - sickness data/absence rate

I am creating a Power BI Dashboard which will provide analytics around sickness absence in my company. I currently have three tables:

 

  • AbsencesTable – this contains a list of all sickness absences from the past few years. Each row is an invidual day of absence. Each row has the employee ID (Payroll No.) the number of Days Lost, and a few other fields.
  • EmployeeData – this contains a list of employees past and present, including their department, their start date, and their end date (which can be blank)
  • DatesTable – a list of unique dates from within the model. 

One of the initial issues I had was calculating absence rates, as this requires me to know the 'Available Days' which is not a figure which my raw data contains. To combat this, I created a new column on DatesTable which was a SUM of the FTE for each employee on that particular date, if they were employed on said date, and if said date was a working day (NETWORKDAYS). Not perfect, but close enough.

 

I also added a number of other columns to the DatesTable, including AbsenceDays (calculated from AbsencesTable), Headcount (also calculated from EmployeeData) and FTE (also calculated from EmployeeData).

 

In terms of relationships:

 

* EmployeeData to AbsencesTable - bidirectional, active, One to Many. Joined on the payroll number.

* DatesTable to AbsencesTable - bidirectional, active, One to Many. Joined on the date field.

 

Most of my visualisations work fine when looking at the company as a whole. The issue I'm having is filtering by department, which is a key ability I need the dashboard to be able to do. It works for some statistics, but specifically does not work for absence rate, headcount and FTE, and I think the issue is that all three of those figures on DatesTable are being calculated using EmployeeData, and no relationship exists between these two tables.

 

I have tried creating a sort of staging table between DatesTable and EmployeeData to try and establish a relationship, but to no avail. There may be a really simple solution I am missing, or an easier alternative way to calculate the problematic statistics I mentioned, but I'm a bit stuck at present. Any help appreciated!

1 REPLY 1
bhanu_gautam
Super User
Super User

@NPEQ 

you can try the following steps:

Create a relationship between DatesTable and EmployeeData based on the department field. This will establish a connection between the two tables and allow you to filter by department.

Once the relationship is established, you can update the calculations for absence rate, headcount, and FTE in the DatesTable to consider the department filter. You can use the RELATED function in DAX to retrieve the department information from the EmployeeData table.

For example, to calculate the headcount for a specific department on a particular date, you can use the following formula in the DatesTable:

 

Headcount = CALCULATE(COUNT(EmployeeData[EmployeeID]), RELATED(EmployeeData[Department]))
Similarly, you can update the formulas for absence rate and FTE to consider the department filter.

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors