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
valavan
Regular Visitor

Consecutive days the employees have not attended three continuous meetings.

Hi,
I am trying to calculate the number of consecutive days the employees have not attended three continuous meetings.
The expected report output is when the employee did not attend three continuous meetings (checking conditions are Missed or Null Value).
Tables:
  • Employee: employee name and his or her details
  • Assignments: assignment date and assignment status (missed, null, completed, or inactive).
The report data is shown below.
 
Date                             Worker name          AssignmentStatus             Consecutive three days missed meeting.
1/1/2023 08:00 AM      Andrew             Completed                                       0
1/1/2023 11:00 AM      Andrew             Inactive                                            0
1/1/2023 01:00 PM      Andrew             Missed                                             1
1/3/2023 12:00 PM      Sara                   Completed                                      0  
1/4/2023 12:00 PM      Sara                   Missed                                            1
1/5/2023 12:00 PM      Sara                   Missed                                            2
1/5/2023 02:00 PM      Sara                   Missed                                            3   
1/5/2023 02:00 PM      Sara                   (null)                                               4  
1/5/2023 02:30 PM      Dennis               Missed                                            5  
1/5/2023 04:00 PM      Dennis              Completed                                      0
1/6/2023 12:00 PM      Dennis              Missed                                            1
1/7/2023 02:00 PM      Dennis              Missed                                            2
1/8/2023 02:00 PM      Dennis              Missed                                            3
1/8/2023 04:00 PM     Dennis               Missed                                            4
 
My Current Code:
 
ConsecutiveMissedMeetings =
    IF(Assignments[AssignmentStatus] IN {" ","Missed"},
        IF(
            CALCULATE(MAX(Assignments[Start]), FILTER('Assignments', Assignments[Start]= EARLIER(Assignments[Start]) - 1)) = Assignments[Start],
           Assignments[Start] + 1,
            1
        ),
        0
    )
I read forums and watched some YouTube, but I was not able to achieve my result.  Appreciate your help
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @valavan ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.

vtangjiemsft_1-1701050543708.png

(2) We can create calculated columns.

Index = RANKX(FILTER('Table',[Worker name]=EARLIER('Table'[Worker name])),[Date],,ASC,Skip)
prevalue = var a=MINX(FILTER('Table',[Worker name]=EARLIER('Table'[Worker name])&&[Column]="Missed"),[Index])
return IF([Index]=a,"Missed",MAXX(FILTER('Table',[Worker name]=EARLIER('Table'[Worker name])&&[Index]=EARLIER('Table'[Index])-1),[Column]))
Column = IF([AssignmentStatus]=BLANK(),"Missed",[AssignmentStatus])
Count1 = IF([Column]="Missed",RANKX(FILTER('Table',[Worker name]=EARLIER('Table'[Worker name])&&[Column]="Missed"),[Date],,ASC))
Column 4 = var a=FILTER('Table',[Worker name]=EARLIER('Table'[Worker name])&&[Column]="Missed")
var b=MAXX(FILTER(a,[Column]<>[prevalue]&&[Index]<=EARLIER('Table'[Index])),[Index])
var c=MAXX(FILTER(a,[Column]=[prevalue]&&[Index]<b),[Index])
var d=MAXX(FILTER(a,[Index]=c),[Count1])
return [Count1]-d
Column 2 = IF(MAXX(FILTER('Table',[Worker name]=EARLIER('Table'[Worker name])&&[Column]="Missed"),[Column 4])>=3,[Worker name])

(3)We can create a measure.

_Worker name = CONCATENATEX(FILTER(VALUES('Table'[Column 2]),[Column 2]<>BLANK()),[Column 2],",")

(4) Then the result is as follows.

vtangjiemsft_2-1701050661492.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @valavan ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.

vtangjiemsft_1-1701050543708.png

(2) We can create calculated columns.

Index = RANKX(FILTER('Table',[Worker name]=EARLIER('Table'[Worker name])),[Date],,ASC,Skip)
prevalue = var a=MINX(FILTER('Table',[Worker name]=EARLIER('Table'[Worker name])&&[Column]="Missed"),[Index])
return IF([Index]=a,"Missed",MAXX(FILTER('Table',[Worker name]=EARLIER('Table'[Worker name])&&[Index]=EARLIER('Table'[Index])-1),[Column]))
Column = IF([AssignmentStatus]=BLANK(),"Missed",[AssignmentStatus])
Count1 = IF([Column]="Missed",RANKX(FILTER('Table',[Worker name]=EARLIER('Table'[Worker name])&&[Column]="Missed"),[Date],,ASC))
Column 4 = var a=FILTER('Table',[Worker name]=EARLIER('Table'[Worker name])&&[Column]="Missed")
var b=MAXX(FILTER(a,[Column]<>[prevalue]&&[Index]<=EARLIER('Table'[Index])),[Index])
var c=MAXX(FILTER(a,[Column]=[prevalue]&&[Index]<b),[Index])
var d=MAXX(FILTER(a,[Index]=c),[Count1])
return [Count1]-d
Column 2 = IF(MAXX(FILTER('Table',[Worker name]=EARLIER('Table'[Worker name])&&[Column]="Missed"),[Column 4])>=3,[Worker name])

(3)We can create a measure.

_Worker name = CONCATENATEX(FILTER(VALUES('Table'[Column 2]),[Column 2]<>BLANK()),[Column 2],",")

(4) Then the result is as follows.

vtangjiemsft_2-1701050661492.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

lbendlin
Super User
Super User

does it have to be in DAX? This data is immutable, so it could also (much easier) be done in Power Query.

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.