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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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