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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AGo
Post Patron
Post Patron

Stacked bar chart with concurrent events between datetimes

My working sessions dataset includes rows with start datetime and end datetime and the column "worker name".

The goal is to return a stacked bar chart with a timeline axis and "number concurrent workers" value, where the legenda is the "worker name" itself. So when I'm analyzing e.g. a period of 3 months and I see a peak which is too high I can zoom my timeline (filtering the dates or drilling down) and see the details.

The problem are the high granularity of data (seconds), and the fact that it's not a punctual time but a duration. It's like I need a combination of a stacked bar chart and a Gantt chart.

I don't even know where to start, please help.

1 ACCEPTED SOLUTION

Thanks for reply, but I need both timeline and duration to be displayed on the x-axis because the Y-axis is needed to be available for "number of concurrent sessions". I think the answer is that power BI (without R) can't manage the concept of time duration as part of a timeline on the x-axis. Something similar is the Gantt chart in the custom visuals section, but not usable in this case.

View solution in original post

4 REPLIES 4
v-cherch-msft
Employee
Employee

Hi @AGo

 

Could you post some simplified data and expected output like this post?It seems you may create a second column with DATEDIFF Function.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sure, here's the dataset.

 

DatasetDataset

 

I calculated also a "Session End DateTime" based on the duration field.

The concept is that every record represent a session which value is equal to one when active from start to end.

The graph should display the time line on the X-axis an the number of concurrent active sessions on the Y-axis, having the working session technician names when consulting would be welcome. So a stacked bar chart with legenda or a line chart with command description should work. The problem with the bar chart is that you can't script how wide the bar should be (eg. from 01/01/01 20pm to 01/01/01 22pm) but its representation is based on a punctual datetime. Someone has a smart way to solve this way of represent duration/interval data?

Hi @AGo

 

Below are workarounds for you to create the visual.

 

1. Use integer to represent the Time and display integer in Y-Axis, there is a similar thread for your reference.
2. Use R visual, please see this similar thread.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for reply, but I need both timeline and duration to be displayed on the x-axis because the Y-axis is needed to be available for "number of concurrent sessions". I think the answer is that power BI (without R) can't manage the concept of time duration as part of a timeline on the x-axis. Something similar is the Gantt chart in the custom visuals section, but not usable in this case.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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