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.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
36 | |
33 | |
18 | |
18 |