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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Richard_Halsall
Helper IV
Helper IV

Weekly Employee total by month

Hi I have been trying to solve this issue for a while now

 

I have a dates table and also an employees table like this:

Richard_Halsall_0-1609931007209.png

I have a measure that calculates total number of employees

 

I need to create a visual similar to this:

Richard_Halsall_1-1609931102984.png

 

Which rather than showing total number of employees by month it will show the weekly employee number by month

For example Jan 2021 would equal 10.8 (54/5) Feb 2021 would equal 10 (40/4) Mar 2021 would equal 24 (96/4) etc

 

Any help would be appreciated. thanks

 

1 ACCEPTED SOLUTION

@Richard_Halsall , Create these in you date table

 

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
Full week flag =( [Week Start date] >= eomonth([date],-1)+1 && [Week Start date] <= eomonth([date], 0) && [Week End date] >= eomonth([date],-1)+1 && [Week End date] <= eomonth([date], 0) ,1,0)

 

Try measure like

[Current employee]/ calculate(distinctcount(Date[Week]), Date[Full week flag]=1)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Richard_Halsall , Create a date table have week number. Divide you current employee by distinct week numbers

column in date table

Week Number = WEEKNUM([Date],2)

 

measure =

[Current employee]/ distinctcount(Date[Week])

 

For current employee refer if this can help https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thanks @amitchandak but I was expecting some different figures. If I look at March 2021 there are 4 full weeks and 3 days in the month, using the measure suggested gives 19.20, is there a way to include full weeks only -

so the result would be 24?

@Richard_Halsall , Create these in you date table

 

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
Full week flag =( [Week Start date] >= eomonth([date],-1)+1 && [Week Start date] <= eomonth([date], 0) && [Week End date] >= eomonth([date],-1)+1 && [Week End date] <= eomonth([date], 0) ,1,0)

 

Try measure like

[Current employee]/ calculate(distinctcount(Date[Week]), Date[Full week flag]=1)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.