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
REGHnoob
Frequent Visitor

Full time employees average and sum of average from start and end date

Hi all

  • I need to find the aggregated number of full time employees (FTE) at a given month and aggregated per year.
    • For instance if there are 35 with decimal 1 and 3 with decimal 0,5 = 36,5 FTE in jan
    • 35 with decimal 1 and 5 with decimal 0,4 = 37,4 FTE in feb
    • 30 with decimal 1 and 12 with decimal 0,5 =  36 FTE in march
    • the ytd would be 36,3. FTE
  • So a sum by month and the average of that sum by year.

Seems so simple but alas. I have given it my best but have come up short. Hope someone out there can help me find the solution.

 

Obviously there are more departments and I do have subcategories related the position of each employee. I have lefter those out for now as the key is to get the total amount per month and per year.

 

I do have a dim_calendar but don't see how I can connect it to the list below - do I connect to start or end date.

 

 

YearDepartmentPersonel_IDSTARTENDDecimal hired 1 = full time
2019TEST25452901-05-2018 00:0031-01-2019 00:001
2019TEST25452901-02-2019 00:0031-12-2019 00:001
2019TEST25589301-06-2018 00:0031-12-2019 00:000,86
2019TEST26229501-07-2018 00:0031-12-2019 00:000,86
2019TEST26802601-03-2018 00:0031-10-2018 00:000,65
2019TEST26802601-11-2018 00:0030-11-2019 00:001
2019TEST26802601-12-2019 00:0031-12-2019 00:000,86
2019TEST27094101-07-2012 00:0031-12-201900:000,86
2019TEST27152401-03-2018 00:0031-08-2019 00:001
2019TEST27152401-09-2019 00:0031-12-2019 00:000,86

 

 

One of the solution I have tried is the one below. It appeared to work but I know for sure it doesn't handle the total by year correctly as it seems it sums all the personal who has been active during the year. For instance - monthly count could be 37, 38, 41 and yearly sum would be 42 because of the number of employees that started and terminated their contract during the year.

 

FTE= var maxdate=
MAX(D_Calendar[Date])
return
CALCULATE(SUM(F_Personel_list[decimal hired]);
FILTER(F_Personel_list;F_Personel_list[START]<=maxdate
&& F_Personel_list[End date] >=maxdate
&& F_Personel_list[decimal hired]>0
)
)
I have also tried som groupby but havent had any luck. 
 
Help would save my bacon. Thx in advance

 BR

Kasper

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @REGHnoob ,

 

If I understand you correctly, you should be able to get the yearly sum by creating a measure as below:

FTE_year =

VAR maxdate =

    MAX ( 'D_Calendar'[Date] )

VAR mindate =

    MIN ( D_Calendar[Date] )

RETURN

    CALCULATE (

        SUM ( F_Personel_list[Decimal hired] ),

        FILTER (

            F_Personel_list,

            F_Personel_list[START] <= mindate

                && F_Personel_list[END] >= maxdate

                && F_Personel_list[Decimal hired] > 0

        )

    )

The result would be shown as below:

1.PNG2.PNG

Pbix as attached, hopefully works for you.

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

First off - Thank you very much for the effort.

 

Havent tested yet as I have been swamped. Been busy with work and a sick kid. Just finished for today and Its way past midnight now  - I am knackered beond belief.

 

Will try this out asap and get with hopefully a solved and a big thanks.

 

br

Kasper

Hi @REGHnoob ,

 

Did the problem solve?

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Hi  v-jayw-msft 

 

Darn it. have to change my original answer to from yes to no. It actually haven't.

 

In a matrix the total doesn't sum correctly.

 

2019-12-02 17_02_39-AMAL  fremmøde og økonomi2 - Power BI Desktop.png

 

 

 

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.