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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
waffle85
Regular Visitor

Counting Full Time Employees By Week

Hi all. I have a fair amount of experience with Tableau, but just switched to Power BI. I have a table that includes Employee, Hours, and Date Worked. I'm trying to calculate what percent of full time an employee is (40 hours worked in a week = 1.0; 20 hours = 0.5 ; 60 hours = 1.0) and then create a line chart that sums those values to show the total full time employee count by week.

 

Any help is greatly appreciated.

 

Thanks,

 

Mike 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

The best way to do this would be to make a Date table (https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/) with a Week column, with a 1:Many relationship with your original table (called Hours, for example).  You can then write a measure like this to go in a visual with your week column.

 

Total Employees =
VAR summarytable =
    SUMMARIZE (
        Hours,
        Hours[Employee],
        'Date'[Week],
        "@HoursWorked", SUM ( Hours[Hours] )
    )
RETURN
    SUMX ( summarytable, IF ( [@HoursWorked] < 40, [@HoursWorked] / 40, 1 ) )

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





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

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi ,  @waffle85 

If you have a date type column,just need to create a weeknum column as below:

Weeknum = WEEKNUM('Table'[Date Worked])

Then create calculate column as below:

1percent of full time by week = 
var a = CALCULATE(SUM('Table'[Hour]),ALLEXCEPT('Table','Table'[Weeknum],'Table'[Employee]))/40
return IF(a>1,1,a)

 

41.png

 

pbix attached

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mahoneypat
Microsoft Employee
Microsoft Employee

The best way to do this would be to make a Date table (https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/) with a Week column, with a 1:Many relationship with your original table (called Hours, for example).  You can then write a measure like this to go in a visual with your week column.

 

Total Employees =
VAR summarytable =
    SUMMARIZE (
        Hours,
        Hours[Employee],
        'Date'[Week],
        "@HoursWorked", SUM ( Hours[Hours] )
    )
RETURN
    SUMX ( summarytable, IF ( [@HoursWorked] < 40, [@HoursWorked] / 40, 1 ) )

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





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

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thanks! That worked great.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.