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
Auski
Helper I
Helper I

Stacked Bar Chart with Duration

Hi all,

 

I am looking at creating a stacked bar graph in PBI for each agent using duration (similar to the excel screenshot below). However when I do add duration to the x-axis, count is my only display option.


What I am trying to recreate:
Excel:

Y-Axis = Agent Name, X-Axis = Status by duration.

Stacked Excel.jpg

PBI:

In the source data, I have converted each field from milliseconds to duration using the following custom column.
Duration custom column.jpg
And ensured the format is in time format

Table view.jpg


What I am getting:

count.jpg

I'm assuming it's possible, but it's obviously not quite as simple as my brain would like.
Any help here would be amazing! Sorry, I'm unable to share data.

Thanks so much

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Auski , Have time in second. Use new dynamic string format and give this format and use

 

""""& QUOTIENT([net],3600) &":" & QUOTIENT(Mod([net],3600),60) &":" & round(MOD(Mod([net],3600),60),0) &""""

 

 

amitchandak_0-1692234360921.png

 

 

Here net is measure in second I converted for format time

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Auski , Have time in second. Use new dynamic string format and give this format and use

 

""""& QUOTIENT([net],3600) &":" & QUOTIENT(Mod([net],3600),60) &":" & round(MOD(Mod([net],3600),60),0) &""""

 

 

amitchandak_0-1692234360921.png

 

 

Here net is measure in second I converted for format time

@amitchandak You my friend are a genius. Thank you very much for that. I doubt I would have even considered dynamic string format as a solution as it wasn't even activated in the settings.

So, this is undoubtably the solution as per screenshot below, however the x-axis doesn't like the format. Do you know if there is a work around here.... or do you think I might have done something wrong down the line?

 

Solution.jpg

 

Of course I can simply turn off the axis and get a satisfactory result, but might be helpful for anyone in future.

Thank you again!!

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.