Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

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 

1 ACCEPTED SOLUTION
Anonymous
Not 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

 

2016-10-31_10-43-33.png

View solution in original post

5 REPLIES 5
nico_k
New 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):

pbi executions.jpg

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] ) 
RETURN
IF( 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())​

 
Anonymous
Not 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
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

Anonymous
Not 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

 

2016-10-31_10-43-33.png

Creating matrix seems to be a good alternative. Smiley Happy

 

Best Regards,

Herbert

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors