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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
TerriAki
Frequent Visitor

Father of Cthulu!! Consecutive streak based on lists and ID

Hi,  

 

I have a time and attendance table and trying to work out the consecutive streak of absence which will start or end in a status  S, SC or SB for each employee.  Column in red font below to give example of what the calculated column should look like (alternative is fine too).   In order to work out continous periods of absence the calculation will need to take into account two tables of codes. One contains a list of codes that would break a continuous period and another list which does not.  Will need to also reset on Employee ID. 

 

T&A table 

Employee IDDate            Status   Streak              Alternative streak
12302-Feb-22RD  
12303-Feb-221  
12304-Feb-22S11
12305-Feb-22RD  
12306-Feb-22RD  
12307-Feb-221  
12308-Feb-22S 1
12309-Feb-22SC 2
12310-Feb-22SB33

123

11-Feb-221  
12312-Feb-22RD  
12313-Feb-22RD  
12314-Feb-22AL  
12315-Feb-22S 1
12316-Feb-22RD 2
12317-Feb-22S 3
12318-Feb-22S 4
12319-Feb-22ME 5
12320-Feb-22RD 6
12321-Feb-22S 7
12322-Feb-22S88
12323-Feb-22RD  

 

Break codes Continuous codes
01 AW
ET BH
L HA
NW ME
RW OD
RX RD
TC RB
TW BL
WB HR
WS PL
XX S
ZL SB
AB SC
AL  
AS  
CL  
EL  
FL  
HD  
HL  
LC  
MB  
ML  
TA  
UL  
1 ACCEPTED SOLUTION
1 REPLY 1
tamerj1
Super User
Super User

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.