Monday, April 23, 2012

Create Burndown chart & exclude weekends in TFS

Our team starts to use TFS for managing Product Backlog, and this is the first time I work on TFS Burndown chart. Google around and I found this page to help us configure Burndown chart to exclude weekend (By default, TFS keeps weekend in the Burndown chart, so it doesn't reflect correctly your team effort). This makes sure your Burndown chart works correctly with any length of sprint (2 weeks or more) Steps: Add code below to Category Group to exclude weekend
Select the filter tab and enter the following : Filter Expression =Weekday(Fields!DateValue.Value,0) Type Integer (to the right of the fx button) Operator < Value 6
The pop-up Window should like this
Then add this code into Report (right click into the Report, select Properties, then select Code)
' Define other methods and classes here Function NumberOfDaysToAdjustForWeekends(ByVal valNow as Date, ByVal startOfSprint as Date) AS Int32 Dim valCurrent As Date = startOfSprint Dim weekendDaysPassed As Int32 = 0 Do While valCurrent < valNow valCurrent = valCurrent.AddDays(1) If (valCurrent.DayOfWeek = DayOfWeek.Saturday Or valCurrent.DayOfWeek = DayOfWeek.Sunday) Then weekendDaysPassed = weekendDaysPassed + 1 End If Loop Return weekendDaysPassed End Function
Finally, add code below into "Work_Item_Count"'s expression
=Code.Burndown ( Sum(Fields!Remaining_Work.Value), Fields!DateValue.Value.AddDays(-Code.NumberOfDaysToAdjustForWeekends(Fields!DateValue.Value, Parameters!StartDateParam.Value)), Parameters!EndDateParam.Value.AddDays(-Code.NumberOfDaysToAdjustForWeekends(Parameters!EndDateParam.Value, Parameters!StartDateParam.Value)))
Source: http://2e2ba.blogspot.com.au/2011/08/tfs-scrum-templates-and-burndown-report.html

Digital Inspiration Technology Guide

Change the world with your passion