Forum Discussion
24 hour based gantt
HI,
I have table with tasks done by staff, and each task has field Start_Date_Time and Close_Date_Time. As all tasks last just few hours and finish same day, I would like to display that in gantt chart but with hours on duration axis. Advice please how to do this. Thanks
- Anonymous9 years ago
Thanks for your quick answer,
As there is no visual for hour based gantt, I created matrix with additional columns for hour based status. Formula example is 08 = IF(AND(HOUR(SCHEDUAL_TBL[START])<=8;HOUR(SCHEDUAL_TBL[CLOSE])>8);1;BLANK())
It would be interesting if Measure could be created with hours column headers, and having same result as one using new columns, and we can always use R solution http://community.powerbi.com/t5/R-Script-Showcase/Schedule-view/m-p/69026/thread-id/43
5 Replies
- AnonymousNot applicable
I know it's been a few years since this question was posed and answered but I am having the same problems and came across this post. I found a visual in AppSource called as Timeline that allows you to create a Gnatt chart with hours/mins.
- v-haibl-msft
Microsoft Employee
Anonymous
There is no Hour type for current version of Gantt visual. Please vote this idea here to make it possible in future version.
Best Regards,
Herbert
- AnonymousNot applicable
Thanks for your quick answer,
As there is no visual for hour based gantt, I created matrix with additional columns for hour based status. Formula example is 08 = IF(AND(HOUR(SCHEDUAL_TBL[START])<=8;HOUR(SCHEDUAL_TBL[CLOSE])>8);1;BLANK())
It would be interesting if Measure could be created with hours column headers, and having same result as one using new columns, and we can always use R solution http://community.powerbi.com/t5/R-Script-Showcase/Schedule-view/m-p/69026/thread-id/43
- v-haibl-msft
Microsoft Employee
Creating matrix seems to be a good alternative. :smileyhappy:
Best Regards,
Herbert
- nico_kNew Member
the mentioned 'as Timeline' AppSource is nice but is not free. I found a line chart will actually come close even if it's less pretty (removed some names with red):
It's a regular linechart with
- X-axis: time as a decimal value (03:15 becomes 3.25) for a continuous x-axis, from a floating time dimension with a record for each minute from 00:00 to 23:59
- Y-axis: The measure 'ExecutionLine' below.
- Legend: In my case an execution package name.
- Tooltips: Properly formatted times
- Data labels: Title -> Content: Custom -> The measure 'PackageLabel' below.
Measures:
ExecutionLine =VAR currentTime = SELECTEDVALUE( 'Tijd'[Tijd_continuous] )VAR packageRank = SELECTEDVALUE( 'PackageExecutionTime'[Package_ranking_perdag] )RETURNIF( NOT(ISBLANK( packageRank ))&& currentTime >= MIN( 'PackageExecutionTime'[Starttijd_continuous] )&& currentTime <= MIN( 'PackageExecutionTime'[Eindtijd_continuous] ),packageRank,BLANK())
'Tijd'[Tijd_continuous] is the floating dimension with 24*60 minutes as decimal.
[Package_ranking_perdag] was added in the data to get the execution packages to show on different heights in the chart. Like this: row_number() over (partition by [Datum] order by [Starttijd], [ExecutionPackageId]). So 1 for the first package that day then +1 for each package afterwards.
[Starttijd_continuous] and [Eindtijd_continuous] are the start and end times of each package, but they need to have the same datatype as 'Tijd'[Tijd_continuous] to show properly in the chart.
PackageLabel =
VAR currentTime = MAX( 'Tijd'[Tijd_continuous] )
VAR endTime = SELECTEDVALUE( 'PackageExecutionTime'[Eindtijd_continuous] )
VAR packageName = SELECTEDVALUE( 'ExecutionPackages'[ExecutionPackage] )
VAR duration = SELECTEDVALUE( 'PackageExecutionTime'[Duur_hhmm] )
VAR tolerance = 0.005 --in case the data types vary between dimension and fact
RETURN
IF(ABS(currentTime - endTime) <= tolerance, packageName & ": " & duration, BLANK())