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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
PMnooBI
Frequent Visitor

Resource hours per week

I have Project Online O data fed in Power BI.

I need to figure out how many hours a particular resource works in a week. I have the "work hours per day" for every task and for every resource. Also the task duration is determiined by start and end dates.

 

Now if I introduce a date slicer(from calendar table) and for example one of the tasks of a resource ends mid week, How do I calculate the work hours for the entire week?

Example: slicer set between 27th march and 1st April

I want to be able to add work hour everyday for the set date range. one task might end on 29th. so I should not add the work hour for that task for the rest of the days as well

 

 

 

 

1 REPLY 1
Anonymous
Not applicable

Hi @PMnooBI ,

Have a try.

 

Measure =
VAR _1 =
    MAXX ( ALLSELECTED ( 'Table 2' ), 'Table 2'[Date] )
VAR _2 =
    MINX ( ALLSELECTED ( 'Table 2' ), 'Table 2'[Date] )
VAR _3 =
    MAX ( 'Table 2'[workday] )
VAR _maxdate =
    IF ( MAX ( 'Table'[end date] ) > _1, _1, MAX ( 'Table'[end date] ) )
VAR _midate =
    IF ( MAX ( 'Table'[start time] ) < _2, _2, MAX ( 'Table'[start time] ) )
RETURN
    DATEDIFF ( _midate, _maxdate, DAY )

vrongtiepmsft_0-1680145461265.png

 

 

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
Community Support Team _ Rongtie

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.