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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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