Create Gantt Chart To Show Duration Between Start Time And End Time Using R Within Power BI

Overview

In this article, we will talk about how we can create a Gantt Chart using R script visual within the Power BI.

In Power BI, there are many custom visuals which provide flexibility to create a Gantt Chart. But my requirement was somewhat different. I have the following scenario and the following types of data.


Scenario

Please refer to the below screenshot.













I have information for different groups with their start time and end time. I want to represent a filled area with the line (duration) for every group.


Example

If Group 1 has a duration from 1:00 AM to 3:00 AM, I want to show the highlighted area between 1:00 PM to 3:00 PM. To represent this type of duration, I have developed the Gantt Chart.


Code

I have uploaded the sample data source file and sample Power BI file on GitHub. You can directly download the code using the following URL.

Download Code


Prerequisites

Before we can proceed further, you must have the following software i