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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Count Employee allocations

I have allocation records, where an employee is allocated to various clients & the employee works at diff departments within the client, employees may be rotated or extended to another task within the client for some other department

Please refer below sample records
i.e. CHARANI is allocated to Godrej on 11 march to 31st Dec
i.e. Chaumel is allocated to LG on 15-March 21 (New Allocation), but again on 4-June-21 she is allocated to another department, since it is "Extension"

 

Sample Data:

EmpIDEmployee NameClientDepartmentStart DateEnd DateStatus
791CHAARANIGodrejSales11-Mar-2131-Dec-21New Allocation
530CHAUMELLGMarketing15-Mar-212-Dec-21New Allocation
530CHAUMELLGProduction4-Jun-211-Apr-22Extension
530CHAUMELGodrejAccount4-Apr-224-Dec-22New Allocation
445VIGANPanasonicSales2-Feb-211-Mar-21New Allocation
445VIGANPanasonicSales3-Mar-2118-Mar-21Extension
445VIGANPanasonicMarketing22-Mar-211-Apr-21Extension
445VIGANLGSales4-Apr-2112-May-22New Allocation
875GORTAISPanasonicProduction17-May-2131-Dec-21New Allocation

 

Problem Statement
Count "New Allocations" & "Extensions"


Notes:
1. If there is a single record in this sheet this means it is "New Allocation"
2. if there are multiple records of a same person, but the client name is same, the entry on the MIN(startdate) is considered "New Allocation" & rest are "Extensions"
3. if there are multiple records of a same person, every time employee is allocated to a new client, the entry on the MIN(startdate) is considered "New Allocation" & rest are "Extensions"

 

Output

New allocations6
Extensions3
1 ACCEPTED SOLUTION

Try to create a new column like below:

status_1 = 
 var rank_ = 
 RANKX(
     FILTER('Table',
        EARLIER('Table'[EmpID])='Table'[EmpID]&&
        'Table'[Client]=EARLIER('Table'[Client])
    ),
    'Table'[Start Date],,ASC,Dense)
return IF(rank_=1,"New Allocation
","Extension")

V-lianl-msft_0-1617849838941.pngV-lianl-msft_1-1617849864009.png

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Note: in Base records the status column is not there, I am looking to create that column, 

I tried using group by EmpID, got the count of entries for each emp but I am clueless what to do next, please help

Try to create a new column like below:

status_1 = 
 var rank_ = 
 RANKX(
     FILTER('Table',
        EARLIER('Table'[EmpID])='Table'[EmpID]&&
        'Table'[Client]=EARLIER('Table'[Client])
    ),
    'Table'[Start Date],,ASC,Dense)
return IF(rank_=1,"New Allocation
","Extension")

V-lianl-msft_0-1617849838941.pngV-lianl-msft_1-1617849864009.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors