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
Anonymous
Not applicable

Cumulative count of employees

I have an assignment table where each record includes an assignment start date, assignment end date and an employee ID. Each assignment is associated with one employee. Basically, I want to create a line chart which displays the count of employees not on assignments for each week, based on the week during which each employee ends their current assignment. Basically if an employee has an assignment end date next week, they would be included in the count for next week and all subsequent weeks. This will be a future forecast calendar and there will be no assignments starting after the end of the current assignment. How would this be done?

2 REPLIES 2
austinsense
Impactful Individual
Impactful Individual

Alright, here's how it's done ...

 

 

=COUNTROWS(
     FILTER( AssignmentsTable,
                        // if you're looking at Mar-16 then this will show all assignments starting before or on 3/1/16
                        AssignmentTable[StartDate] <= MIN(Calendar[Date]) &&
// if you're looking at Mar-16 then this will include all assignments ending after 3/31/16 AssignmentTable[EndDate] > MAX(Calendar[Date])
)
)

 

You may have to play around with signs (<, >, <=, >=) and the MIN/MAX but this is the basic idea.  You definitely need a calendar table for this.

 

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Could you post some sample data with your expected result in this case?Smiley Happy

 

Regards

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.