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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
ConnieMaldonado
Responsive Resident
Responsive Resident

Stacked Bar Chart with Start Time, Duration and Multiple Activities on One Row

I'm creating a report to review the efficiency of technician activities on a daily basis.  I'm looking at 3 categories of effort:  work (actual time on the job), drive time, and comparing that to actual clock in/out time.  In any event, I need a bar chart that has start time on the horizontal axis, and category on the y-axis.  For each category, I need to see all activities on a single row.  A couple of questions:

  1. How to get the start time on the x-axis? 
  2. How do I group all activities for each category on the same row?

Thanks.

Image.PNGImage 2.PNG

 

Gantt Data Image.PNG

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @ConnieMaldonado 

 

Based on your description, I creatad data to reproduce your scenario.

Table:

e1.png

 

Duration is a calculated column as below.

 

Duration = DATEDIFF('Table'[Start time],'Table'[End Time],MINUTE)

 

 

You may use Gantt 2.2.3 from marketplace, go to 'Visualization' ribbon, click 'Formatting'=>'General', set 'Duration unit' as 'Seconds' and 'Duration min' as 0, click 'Date type', set 'Type' as 'Hour'.

e2.png

 

e3.png

 

Result:

e4.png

 

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

8 REPLIES 8
Vishnu_Kas
New Member

Hi @ConnieMaldonado @BA_Pete @kewaynes @v-alq-msft ,

 

I have a quick query in regard to how to use a stacked bar chart in Power BI which would show the category vs. Time.

 

I was able to create one in Excel using time series But trying to figure out the same in Power BI Visual.

 

It would be really helpful if someone could share their thoughts on the same. Please feel free to reach out to me on any additional information.

 

Excel Graph:

I colored the cells of Layover to White (So it shows as a gap), Blue highlighted are all Travel times.

Vishnu_Kas_0-1693988287579.png

 

Raw data Sample: 

ID NumberStart TimeTravelLayoverTravelLayoverTravelLayoverTravelLayoverTravelLayoverTravel
305:25:0000:23:0000:07:0000:31:0000:14:0000:30:0000:15:0000:42:0000:18:0000:40:0000:20:0000:36:00
405:25:0000:23:0000:07:0000:25:0000:05:0000:32:0000:13:0000:40:0000:20:0000:45:0000:15:0000:37:00

 

Regards

Vishnu

Hi @Vishnu_Kas ,

 

I suggest that you open a new post in the Desktop forum for this:  Desktop forum 

You'll have a far higher chance of getting a quick resolution there.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




v-alq-msft
Community Support
Community Support

Hi, @ConnieMaldonado 

 

Based on your description, I creatad data to reproduce your scenario.

Table:

e1.png

 

Duration is a calculated column as below.

 

Duration = DATEDIFF('Table'[Start time],'Table'[End Time],MINUTE)

 

 

You may use Gantt 2.2.3 from marketplace, go to 'Visualization' ribbon, click 'Formatting'=>'General', set 'Duration unit' as 'Seconds' and 'Duration min' as 0, click 'Date type', set 'Type' as 'Hour'.

e2.png

 

e3.png

 

Result:

e4.png

 

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Is there any way to get this to be a constant scale? For instance, in the below, I want it to show all the hours of the day and not just based on the time the vehicle was working...

 

kewaynes_0-1688678533479.png

 

Thanks  Allan.  Big help.  Thank you.

BA_Pete
Super User
Super User

Hi @ConnieMaldonado 

 

I'd recommend getting a gantt chart from the visual store for this. It should work just fine with your current data format.

I get the following results with the Gantt Chart by MAQ Software:

ConnieMaldonado.PNG

 

There may be some work to do on chart scaling etc., or you may find another visual that works better, but a start.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Could you clarify which type of file you're looking for an example of? If you're trying to adjust the axis to show time intervals like "12:00 AM" and "12:30 AM", I can guide you on how to change the axis settings for that.

Thank you!  I tried the exact same visual and another one as well - the issue (as you said) is scaling.  I can't get the hourly time scale.  I even reached out to MAQ who said they'd add hourly time scale to the backlog.  Also, the time is added by category, rather than allowing multiple activities on the same row.

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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