Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

Total Duration from a list of tasks

Good Morning guys,


I need some help with the next issue- I'll try to explain myself the best I can.

My data looks like the following, I have a number of tasks that starts at a day and have a duration. For example, task 1 was started in day 1 and had a duration of 23 days (it ended in day 23), task 2 started in day 3 and ended in day 20 (17 days of duration), etc. Then task 1 changes from the department from X to Y and starts at day 24 with a duration of 1 until it ends (idem with task 2 but from day 21).


My data is distributed in the following way:


Task     Day    Duration   Type of Department

1          1        1                      X

1          2        2                      X

1          3        3                      X

2          3        1                      X

1          4        4                      X

2          4        2                      X

3          4        1                      X


1         20       19                    X

2         20       17                    X


1         21       19                    X

2         21       1                      Y

1         24       1                      Y
2         24       4                      Y


So as you can see I have a column for the number of the task, a column for the day where I take the photo of the current state and a column that tells me the duration that the task has until the current day.


My problem is that I need to plot in a graphic the average duration that takes for each department to accomplish the tasks (department X -->18 (task2) + 23 (task1) /2 = 20,5).

How can I made a measure that tells me just the maximum duration of each task for each department?


Thanks a lot!!



somthing like this?

maxTDur = MAX(Table2[Duration  ])


Tanks for your answer @WolfBiber but it is not working as I would like to.


In order to show the data, I'll put it in a graphic that needs to show me the average of time for each type of department.


It means that it will be a line graphic where line 1 is the average time that takes for all the tasks to be completed in department X (as an example).


That is why I need to extract the maximum time that takes for a task to be in a department avoiding the previous values.


With your solution I can extract the value of the MAX but I am not able to make an average of these values according the department!

Helpful resources

2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors