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
freakdaddy
Regular Visitor

Need help with stacked bar chart with variable data columns

I'm trying to represent a timeline of multiple phone agents activities.  Activities are represented starting at a point to time (datetime) and have a type (available, on call, on break, etc) and a duration.  The visual I am trying to create is similar to a horizontal stacked bar chart however the activities are variable per agent and I would like the types to always be represented by the same color.  I have included data and a manually created representation of what I am trying to accomplish.  Is there a way to do this with power bi?

AgentdatetimedurationType
agent112/20/2023 08:001available
agent112/20/2023 09:00.25break
agent112/20/2023 09:15.5on call
agent112/20/2023 09:451available
agent112/20/2023 08:00.75on call
agent212/20/2023 08:452available
agent212/20/2023 10:451on call
agent212/20/2023 11:451.5on call
agent212/20/2023 13:151lunch

 

 

agentreport.png

2 REPLIES 2
freakdaddy
Regular Visitor

The way that table was formatted by the forum distorted the data.  There is a datetime column which for example should show "12/20/2023 08:00" and then there is a duration of "1".  Furthermore your example is apparently grouping the activities unlike shown in my example.  Agent1 has 2 activities on their timeline where they were "available" and the bar chart should match that.  In total agent1 should have 5 bars in their timeline while agent2 should have 4.  Also it shouldn't be a type 100% bar chart because the datetimes start and end at different times per agent.  (I didn't do a good job of showing the difference in start times on my hand drawn chart)

 

Here is a better example chart...

 

agentreport.png

Anonymous
Not applicable

Hi @freakdaddy ,

If I understand correctly, the issue is that you want to show a timeline of multiple agents activities with stacked bar chart. Please try the following methods as a workaround:

1.Create the simple table. 

vjiewumsft_0-1703733070681.png

2.Select the Stacked bar chart visual.

vjiewumsft_1-1703733095556.png

 

 

3.Move the agent field into the Y-axis and move type to the Legend.

vjiewumsft_2-1703733103879.png

 

4.The result is shown below.

vjiewumsft_3-1703733110694.png

 

Alternatively, you can also use a column chart to implement a timeline of agent activity.

Solved: Multiple variables in a stacked column chart in po... - Microsoft Fabric Community

 

Looking forward to your reply.

Best Regards,

Wisdom Wu

 

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.