Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
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
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 )
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.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.