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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Rubal_Islam
Helper II
Helper II

Count Number of Employees who has worked more than 38 and less than 56 hours per week

Hi All,

I need a bit of help witht the below formula.
I am trying to count number of employess who has worked more than 38 hours and less than 56 hours per week.
I also have a date table where i have a week number column and connected with employee table with the date column.

 

Measure = CALCULATE(
DISTINCTCOUNT(Master_data[Employee Num]),
FILTER(Master_data,Master_data[Hours Worked]>38 && Master_data[Hours Worked]<56))
 
This is the base table. week number for the month of March 22 for a selected location. 
Rubal_Islam_0-1648593577483.png

 

However as soon as i bring the measure in, it becomes blank

Rubal_Islam_0-1648599006513.png

 


Any help is appreciated.

Thank you.

1 ACCEPTED SOLUTION
VijayP
Super User
Super User

@Rubal_Islam 

 
you need to follow segmentation
 
use this file and let me know whether this helps you!
Please share your Kudos



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


View solution in original post

7 REPLIES 7
VijayP
Super User
Super User

@Rubal_Islam 

 
you need to follow segmentation
 
use this file and let me know whether this helps you!
Please share your Kudos



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


I will check it out. Thanks Vijay, Much Appreciated.

Tutu_in_YYC
Resident Rockstar
Resident Rockstar

Hi Rubal_Islam,
If it blanks, it means that there is no employee that satisfy that filter context:

- Are you sure you have employees working with that hours in that weeks?

- Is [Hours Worked] a measure or a column? and is it the right data type?

 

Hi There,

I have changed the formula to show  greater than 38 and lower than 56. it is still blank for 1 given week.

You can see on the right table that there are individual employees who has worked more than 38 hours that week.

I think my formula is not taking it to the individual employee level, rather doing it as a whole?

Rubal_Islam_0-1648595147572.png

 

Could it be the weekNumber column is not accurate? Because in a year, there is a max of 52 weeks. Weeknumber 91 doesnt make sense, but maybe im missing a context here. 21st March should be week no 12.

If you have a pbix, I can have a look.

@Tutu_in_YYC @  weeknumber had it sum instead of don't summarize. that is not the issue here.

The measure looks right. The issue must be something else, eg a relationship/visual configuration

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.