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

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

Reply
kumarrajesh
New Member

Re: how do I post a comment/question

I need help on getting employees who are absent for more than 10 consecutive days

Calendar table with Date column
UserMst table having employee_name, Punch_Date, Attendance as Present/Absent

i tried many measures to calculate but not getting the result. 

1 REPLY 1
amitchandak
Super User
Super User

@kumarrajesh , With help from date table

 

Create these columns in Date Table joined to date of your table
Work Day = if(WEEKDAY([Date],2)>=6,0,1)
Work Date = if(WEEKDAY([Date],2)>=6,BLANK(),[Date])
Work Date Cont = if([Work Day]=0,maxx(FILTER('Date',[Date]<EARLIER([Date]) && [Work Day]<> EARLIER([Work Day]) ),[Date]),[Date])
Work Date cont Rank = RANKX(ALL('Date'),[Work Date Cont],,ASC,Dense)

 

COlumn in Attendance table
Cont =
Var _date = related('Date'[Work Date cont Rank])
var _cnt = calculate(DISTINCTCOUNT(Table[Date]), filter(Table, Table[Emp ID] = earlier([Emp ID])))
return
if(_cnt >10,1, 0)


Now you can create a meausre
calculate(count(Table[Emp ID]), filter(Table, Table[Cont]=1))

 

 

Traveling Across Workdays - What is next/previous Working day
https://community.powerbi.com/t5/Community-Blog/Travelling-Across-Workdays-Decoding-Date-and-Calenda...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.

Top Solution Authors
Top Kudoed Authors