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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
RobBeijers312
Helper I
Helper I

Calculating FTE per department with Department movements

Hi, 

 

I've got two tables with employee data. One of them has the contractdata and current department, the other has all the department moves of the employees.

Contractdata table example:

NameEmployeeidContractstartdateContractenddateCurrent department FTE 
Frank11-11-2023 Finance          1,00
Adam21-1-2022 Finance          0,80
Ryan31-1-202431-8-2024Sales          1,00
Vera41-6-2024 Purchase          0,60
Stefan51-1-2023 Purchase          1,00
Simon61-1-2023 Sales          0,80
Shannon71-1-202231-3-2024Finance          1,00

Department moves table:

NameEmployeeidStartdateEnddateDepartment FTE 
Frank11-11-2023 Finance 1,00
Adam21-1-202231-1-2023Sales 0,80
Adam21-2-2023 Finance 0,80
Ryan31-1-202431-8-2024Sales 1,00
Vera41-6-2024 Purchase 0,60
Stefan51-1-202331-8-2023Finance 1,00
Stefan51-9-2023 Purchase 1,00
Simon61-1-202330-4-2024Purchase 0,80
Simon61-5-2024 Sales 0,80
Shannon71-1-202230-6-2023Sales 1,00
Shannon71-7-202331-3-2024Finance 1,00
1 ACCEPTED SOLUTION

Hi @RobBeijers312 ,

Please try to use the below mentioned measure and if you filter the year using the slicer , then the measure will give the result based on the current selection.

 

FTE_Measure_Dynamic =

VAR SelectedYear = SELECTEDVALUE('DateTable_FTE'[Year],2024) -- Default to 2024 year if no selection

VAR StartDate = MINX(FILTER('DateTable_FTE', YEAR('DateTable_FTE'[Date]) = SelectedYear), 'DateTable_FTE'[Date])

VAR EndDate = MAXX(FILTER('DateTable_FTE', YEAR('DateTable_FTE'[Date]) = SelectedYear), 'DateTable_FTE'[Date])

VAR TotalDays = COUNTROWS(FILTER('DateTable_FTE', YEAR('DateTable_FTE'[Date]) = SelectedYear))

 

RETURN

SUMX(

    FILTER(

        'Department_moves',

        NOT(ISBLANK([Startdate])) &&

        ([Startdate] <= EndDate) &&

        (ISBLANK([Enddate]) || [Enddate] >= StartDate)

    ),

    VAR EffectiveStart = MAX([Startdate], StartDate)

    VAR EffectiveEnd = MIN(IF(ISBLANK([Enddate]), EndDate, [Enddate]), EndDate)

    VAR DaysActive = DATEDIFF(EffectiveStart, EffectiveEnd, DAY) + 1

    VAR FTEValue = SUBSTITUTE(Department_Moves[ FTE ], ",", ".") * 1

    RETURN (DaysActive * FTEValue) / TotalDays

)

 

If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.

View solution in original post

5 REPLIES 5
V-yubandi-msft
Community Support
Community Support

Hi @RobBeijers312 ,

Thank you for contacting the Microsoft Fabric community. Could you kindly try the following.

FTE_2023_Measure =
VAR Start2023 = DATE(2023, 1, 1)
VAR End2023 = DATE(2023, 12, 31)
VAR DaysIn2023 = 365
 
RETURN
SUMX(
    FILTER(
        'Department_moves',
        NOT(ISBLANK([Startdate])) &&
        ([Startdate] <= End2023) &&
        (ISBLANK([Enddate]) || [Enddate] >= Start2023)
    ),
    VAR EffectiveStart = IF([Startdate] < Start2023, Start2023, [Startdate])
    VAR EffectiveEnd = IF(ISBLANK([Enddate]) || [Enddate] > End2023, End2023, [Enddate])
    VAR DaysActive = DATEDIFF(EffectiveStart, EffectiveEnd, DAY)+ 1
    VAR FTEValue = SUBSTITUTE(Department_Moves[ FTE ],",",".")*1
    RETURN (DaysActive * FTEValue) / DaysIn2023
)
 
 
 
 
 
 
 
 
FTE_2024_Measure =
VAR Start2024 = DATE(2024, 1, 1)
VAR End2024 = DATE(2024, 12, 31)
VAR DaysIn2024 = 366
 
RETURN
SUMX(
    FILTER(
        'Department_moves',
        NOT(ISBLANK([Startdate])) &&
        ([Startdate] <= End2024) &&
        (ISBLANK([Enddate]) || [Enddate] >= Start2024)
    ),
    VAR EffectiveStart = IF([Startdate] < Start2024, Start2024, [Startdate])
    VAR EffectiveEnd = IF(ISBLANK([Enddate]) || [Enddate] > End2024, End2024, [Enddate])
    VAR DaysActive = DATEDIFF(EffectiveStart, EffectiveEnd, DAY) + 1
    VAR FTEValue = SUBSTITUTE(Department_Moves[ FTE ],",",".") * 1
    RETURN (DaysActive * FTEValue) / DaysIn2024
)

 

If my response solved your query, please mark it as the Accepted solution to help others find it easily.

And if my answer was helpful, I'd really appreciate a 'Kudos'.

Hi,

@V-yubandi-msft 

The measure works, but is it possible to combine them into one measurethat works for all years.

At the moment the measure doesn't reference the date table, wich is needed for the report.

RobBeijers312_0-1743492815163.png

 

Thanks in advance!

Hi @RobBeijers312 ,

Please try to use the below mentioned measure and if you filter the year using the slicer , then the measure will give the result based on the current selection.

 

FTE_Measure_Dynamic =

VAR SelectedYear = SELECTEDVALUE('DateTable_FTE'[Year],2024) -- Default to 2024 year if no selection

VAR StartDate = MINX(FILTER('DateTable_FTE', YEAR('DateTable_FTE'[Date]) = SelectedYear), 'DateTable_FTE'[Date])

VAR EndDate = MAXX(FILTER('DateTable_FTE', YEAR('DateTable_FTE'[Date]) = SelectedYear), 'DateTable_FTE'[Date])

VAR TotalDays = COUNTROWS(FILTER('DateTable_FTE', YEAR('DateTable_FTE'[Date]) = SelectedYear))

 

RETURN

SUMX(

    FILTER(

        'Department_moves',

        NOT(ISBLANK([Startdate])) &&

        ([Startdate] <= EndDate) &&

        (ISBLANK([Enddate]) || [Enddate] >= StartDate)

    ),

    VAR EffectiveStart = MAX([Startdate], StartDate)

    VAR EffectiveEnd = MIN(IF(ISBLANK([Enddate]), EndDate, [Enddate]), EndDate)

    VAR DaysActive = DATEDIFF(EffectiveStart, EffectiveEnd, DAY) + 1

    VAR FTEValue = SUBSTITUTE(Department_Moves[ FTE ], ",", ".") * 1

    RETURN (DaysActive * FTEValue) / TotalDays

)

 

If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.

Thanks, it works!

RobBeijers312
Helper I
Helper I

The expected result:

RobBeijers312_0-1743426871168.png

 

See two examples below.

Employee 1 - Frank:

2023 = 61 days / 365 days * 1,00 FTE = 0,17 FTE Finance

2024 = 366 days / 366 days * 1,00 FTE = 1,00 FTE Finance

 

Employee 6 - Simon:

2023 = 365 days / 365 days * 0,80 FTE = 0,80 FTE Purchase

2024 = 121 days / 366 days * 0,80 FTE = 0,26 FTE Purchase

2024 = 245 days / 366 days * 0,80 FTE = 0,54 FTE Sales

 

The employeeid of contractdata has a one to many relationship towards employeeid of departmentmoves. There are no relationships between the date table and both tables.

 

Can someone help me with this measure?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.