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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ferk_
Frequent Visitor

Get employee names from a count of employees

Hi,

For now I have this formula (Measure):

#Work Hours = CALCULATE(COUNTA(Employees[ID]),filter(Employees,Employees[WorkHours]>45))

This is returning the number of employees that worked more than 45 hours. I need to return the list of employees (name) that worked more than 45 hours in a visual (can you suggest me something) like Table or Card. I have the column Name in the Employees table. 


Any help/tip is welcome. If you need more information/clarification tell me.

Thank you,
Ferk

1 ACCEPTED SOLUTION
ferk_
Frequent Visitor

Thank you for your answers @v-jianpeng-msft and @jeewats!

I found this solution:

Employees =
CONCATENATEX(
            FILTER(
                Employees,
                Employees[WorkHours] > 45 
            ),
            Employees[Name],
            " , "
    )

View solution in original post

3 REPLIES 3
ferk_
Frequent Visitor

Thank you for your answers @v-jianpeng-msft and @jeewats!

I found this solution:

Employees =
CONCATENATEX(
            FILTER(
                Employees,
                Employees[WorkHours] > 45 
            ),
            Employees[Name],
            " , "
    )
v-jianpeng-msft
Community Support
Community Support

Hi, @ferk_ 

I'm happy to answer your questions. I suggest using the following method to filter the Work Hours>45 employee rows, which is very easy to do. I created a sample with the main data as follows:

8.png

Let's create a table visualization:

9.png

We set the Work Hours in the filters >> show items when then values >> is greater than >> Enter 45 in the input box below >> Apply filter

10.png

Here are the results:

11.png

The second way, we can create a slicer as follows:

12.png

Move the slider to 45:

13.png

This also allows filtering to be achieved. If the above solutions can help you, that's great. I've provided my sample PBIX file below.

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

jeewats
New Member

One easy thing you could do is wrap that in an IF statement and create two categories, those that work > 45 hours and those that don't. Then create a table with all employee names and use that measure as a filter on the table. That should only show those that worked greater than 45 hours. There are probably more elegant ways to do it, but that's the quick, dirty way I'd do it.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors