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
rdops
Helper III
Helper III

Count if hours = less than

Hi all, mee again needing some help.

I am doing a team capacity report and would like to show which roles have more available hours in a period. Say, 

If role name = Project Manager and the hours booked on a person who is a project manager is less than 70 (per month) than count.

 

I also wanted to show people on a specific role that have zero hours allocated on a month and again display them by skills. E.g

Mary and John are both Project managers and they both have zero hours booked in June. Paul, Ani and Trish are Copywriters and they all have zero hours booked. I want a report that tells me tha I have 2 Project managers and 3 Copywriters completely free. Then I want to be able to click on these roles and see who are the people within those roles who are completely free (or half allocated).

 

Hope it makes sense and hope you can hellp me 🙂 

1 ACCEPTED SOLUTION

Hi @rdops 

If all columns are in one table,

It is better to create a date table and relate the date with your main table.

Measure = CALCULATE(SUM('Table'[hours]),FILTER(ALLSELECTED('Date'),'Date'[year-month]=MAX('Date'[year-month])),VALUES('Table'[id]))

Measure 2 = CALCULATE(DISTINCTCOUNT('Table'[id]),FILTER('Table',[Measure]<=70))

 

Best Regards

Maggie

 

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @rdops 

For example, you have tables below:

please create measures

Measure = CALCULATE(SUM('Table'[hours]),FILTER(ALLSELECTED('Date'),'Date'[year-month]=MAX('Date'[year-month])),VALUES('Table 2'[id]))

Measure 2 = CALCULATE(DISTINCTCOUNT('Table 2'[id]),FILTER('Table',[Measure]<=70))

Capture14.JPGCapture15.JPGCapture16.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for that, but how do you calculate if all the fields are on the same table? 

Hi @rdops 

If all columns are in one table,

It is better to create a date table and relate the date with your main table.

Measure = CALCULATE(SUM('Table'[hours]),FILTER(ALLSELECTED('Date'),'Date'[year-month]=MAX('Date'[year-month])),VALUES('Table'[id]))

Measure 2 = CALCULATE(DISTINCTCOUNT('Table'[id]),FILTER('Table',[Measure]<=70))

 

Best Regards

Maggie

 

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
Top Kudoed Authors