Forum Discussion

freakdaddy's avatar
freakdaddy
Regular Visitor
2 years ago

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

 

 

2 Replies

  • Anonymous's avatar
    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. 

    2.Select the Stacked bar chart visual.

     

     

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

     

    4.The result is shown below.

     

    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

     

  • freakdaddy's avatar
    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...