Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have 2 tables, one is a list of employees with employment status and the other is a list of tasks assigned to those employees with the task status. Everthing is linked by EE_ID, but I did have to create a table of just unique values to avoid Many:Many between the 2 source tables, so my relationship looks like this:
Task Table *->1 Unique EE_ID 1<-* EE Status
I need create a measure that tells me the list of Incomplete tasks when an Employee is Terminated so those tasks can be reassigned.
I would like to present the results in a table or matrix.
Desired Ouput:
EE_ID | Name | Status | Task Count |
1111 | John Smith | Terminated | 2 |
2222 | Bob Jones | Terminated | 0 |
EE_Status:
EE_ID | Name | Status |
1111 | John Smith | Terminated |
2222 | Bob Jones | Terminated |
3333 | Jane Doe | Active |
Task table:
EE_ID | Task_Name | Task_Status |
1111 | Visit | Complete |
1111 | Visit | Incomplete |
1111 | Eval | Incomplete |
2222 | Visit | Complete |
2222 | Visit | Complete |
2222 | Eval | Complete |
3333 | Visit | Complete |
3333 | Visit | Incomplete |
3333 | Eval | Incomplete |
Solved! Go to Solution.
Hi @aflintdepm ,
You could use below measure -
Measure =
COUNTROWS (
FILTER (
'Task table',
'Task table'[EE_ID] = MAX ( EE_Status[EE_ID] )
&& 'Task table'[Task_Status] = "Incomplete"
&& MAX ( EE_Status[Status] ) = "Terminated"
)
) + 0
output -
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hello @aflintdepm,
Can you please try the following approach:
IncompleteTasksForTerminated =
VAR TerminatedEmployees =
FILTER (
'EE_Status',
'EE_Status'[Status] = "Terminated"
)
VAR IncompleteTasks =
FILTER (
'Task Table',
'Task Table'[Task_Status] = "Incomplete"
)
VAR Result =
COUNTROWS (
FILTER (
'Task Table',
'Task Table'[EE_ID] IN VALUES (TerminatedEmployees[EE_ID]) &&
'Task Table'[Task_Status] = "Incomplete"
)
)
RETURN
Result
Hope this helps!
Hi @aflintdepm ,
You could use below measure -
Measure =
COUNTROWS (
FILTER (
'Task table',
'Task table'[EE_ID] = MAX ( EE_Status[EE_ID] )
&& 'Task table'[Task_Status] = "Incomplete"
&& MAX ( EE_Status[Status] ) = "Terminated"
)
) + 0
output -
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
@Samarth_18
Thank you for the response. Can you please clarify the function of the MAX in the measure? Other than that, I believe I understand the syntax
@aflintdepm , It's just to pick a value of EE_ID, Status from the current context.
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |