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

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
Employee
Employee

Hi @Anonymous,

 

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

 

Regards

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.