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

Count number of Employees + Productivity - Refined

Hi everyone, I have a question that consist of 2 parts. Part 1 is count active Employees over a given period. Part 2 is to check if the company is more productive with more/fewer employees.

 

PART 1

I would like to count the number of active employees in a given period.

 

I have a facttable: FactHarvest which is a table where employees fill in their time registration, it looks like this:

DateClientProjectHoursBillableBillable RateBillable AmountTaskTypeNameEmployee
dinsdag 1 januari 2019Data WiseCloud Architecture8No86688InternNon-billableKlaas Wouters
Woensdag 6 februari 2019 AbInbevCustomer interaction PoC8Yes90720Billable Customer TimeBillableKlaas Wouters
Vrijdag 1 maart 2019Data WisePyspark8Yes86688InternNon-BillableAstrid Lemmens
Vrijdag 1 maart 2019Data WisePyspark8Yes86688InternNon-BillableKlaas Wouters
Vrijdag 5 april 2019Ab InbevCustomer interaction PoC8Yes90720Billable customer timeBillableKlaas Wouters
Vrijdag 5 April 2019Data WisePyspark8Yes86688InternNon-BillableAstrid Lemmens
Vrijdag 5 April 2019Airport CompanyPipeline8yes86688Billable customer timeBillableRandy cuppens
Maandag 8 April 2019Data WisePyspark8Yes86688InternNon-BillableAstrid Lemmens
Maandag 8 April 2019Airport CompanyPipeline8yes86688Billable customer timeBillableRandy cuppens



And I have a dim table with all of the employees, further there is no information in this table! (So no start and end date per employee)

Name
Klaas Wouters
Astrid Lemmens
Randy Cuppens

 

 

In the Sample data a new Employee has joined the company on vrijdag 1 maart 2019 (Astrid Lemmens) and on vrijdag 5 April 2019 (Randy Cuppens). Also Klaas Wouters left on Maandag 8 April 2019 as we don't see that name anymore. The end goal would be a (line)graph: X-Axis Month, Y-Axis number of Employees. The line graph should show the trend of employee growth/decline like this: 

Graph.PNG

 

PART 2

In the second part we want to check if the increase of Employees has a positive affect on Productivity. So we want to:

- Divide revenue by TotalHours worked or by Total Employees of that period

- Divide Costs by TotalHours worked or by Total Employees of that period

 

Herefor I have another Facttable used, this fact table's grain: One row is one accountant LineItemover a month.
FactSilverfin looks like this:

Line ItemMonthValueTrue ValueUitgave (Outcome)Inkomsten (Income)MonthnameLevel
749000 Diverse bedrijfsopbrengstenPTD 01/2019-763,22-763,22-763,220dinsdag 1 januari 20192
700000 OmzetPTD 02/20192338233802338vrijdag 1 maart 20192
602102 Consultant 3PTD 12/20198250-8250-82500zondag 1 december 20192
612090 RestaurantkostenPTD 11/2019661,7-661,7-661,70vrijdag 1 november 20192
700001Omzet 1PTD 03/20199091,49091,409091,4vrijdag 1 maart 20192

 

Thus what we want to do with these data is see how the number of Employees influences our revenue and costs. Want to make it look like somethign like this:

Productivity.PNG

Any ideas how to do this?

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

The solution to my problem was actually really simple in the end. I fixed part one with following formula 😅

 

EmployeeCount = CALCULATE(DISTINCTCOUNT(FactHarvest[NameEmployee]))
 
Part two after that step wass relative simple as well:
 
ProductivityIncomeHours = DIVIDE([totalIncome];[TotalHours])
ProductivityOutcomeHours 
= DIVIDE([TotalExpense];[TotalHours])
ProductivityIncomeEmployees = DIVIDE([totalIncome];[EmployeeCount])
ProductivityOutcomeEmployees = DIVIDE([TotalExpense];[EmployeeCount])
 
This resulted in this Graph:
ProductivityPlusEmployee.PNG
 
Now need to figure out how I can get rid of the "false negative number" of employees count which is due to having an empty value on my months.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

The solution to my problem was actually really simple in the end. I fixed part one with following formula 😅

 

EmployeeCount = CALCULATE(DISTINCTCOUNT(FactHarvest[NameEmployee]))
 
Part two after that step wass relative simple as well:
 
ProductivityIncomeHours = DIVIDE([totalIncome];[TotalHours])
ProductivityOutcomeHours 
= DIVIDE([TotalExpense];[TotalHours])
ProductivityIncomeEmployees = DIVIDE([totalIncome];[EmployeeCount])
ProductivityOutcomeEmployees = DIVIDE([TotalExpense];[EmployeeCount])
 
This resulted in this Graph:
ProductivityPlusEmployee.PNG
 
Now need to figure out how I can get rid of the "false negative number" of employees count which is due to having an empty value on my months.
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

If your fact table consists of an employee per day then you can simply create a Measure like below

Measure = COUNTROWS( FactHarvest )

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

Anonymous
Not applicable

One row in the fact table is equal to one time registration. So then if I make a graph with month on x-axis and count on Y-axis I get all the rows counted for that month which is 28 to 31 days *number of employees for each day which is too much:

 

Employeesmuch.PNG

Anonymous
Not applicable

Anyone has any idea?

Can you share a better sample data and sample output.

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.