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
gopalm
New Member

Getting list of function violation where the employee belongs

Hi so I have 2 tables connected to each other through Employee ID. One is HR list of employees and second is Violations.

I have created a slicer by using employee’s name so anyone can query a particular employee and they will get count of violations of an employee.

Each employee belongs to a particular function. I want to create a measure which also tells me the number of employees in the same function who have had any kind of violations.

So for Eg - If I have selected Jamie Franco in the slicer and since he belongs to GL Global function, I should also be able to see how many employees in GL Global function had violations

 

Screenshot 2019-09-09 at 1.24.27 AM.pngScreenshot 2019-09-09 at 1.24.47 AM.pngScreenshot 2019-09-09 at 1.24.33 AM.png

 

1 REPLY 1
OwenAuger
Super User
Super User

Hi @gopalm 

You need a measure that retains the visible value(s) of Employee Function but otherwise clears filters on Employee, then calculates the number of violations.

 

I created a dummy pbix here.

 

Assuming Employee Violations is already defined, the Function Violations measure I created looks like this:

Function Violations = 
CALCULATE ( 
    [Employee Violations],
    VALUES ( Employees[Function] ),
    ALL ( Employees )
)

I would also recommend you remove the Name column from the Violations table as it's not needed.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

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.