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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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