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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register 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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.