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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Danbert
Frequent Visitor

Stacked Bar Chart

Hi

 

In the below visual, my source data is as it appears in the upper table, but I need to find a way to manipulate the data so it appears like it does in the lower table.

 

I need to create a stacked bar chart in power bi as in the example below, and I can do that by using the upper table as a source, but I can not find a way to sort it so that the most billable time is sorted first, then the non-billable, then the absence, but I can only get it to sort by total time.  With the lower table as a source this is not a problem.  

 

Can anyone enlighten me as to how I can either transform the upper table to the lower one, or how I can get my desired result from the structure in the upper table?

 

 

Capture.PNG

1 ACCEPTED SOLUTION

Hi @Danbert ,

Dummied up a table for you, you will end up with a table like this by selecting the Type Column and Selecting Pivot on the Transform tab. Use Time as the values.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathanielpivot 234.PNG

 







pivot 23.PNG

 The picture below shows both the selection for Pivot Column and the resulting table.

pivot 2.PNG

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

8 REPLIES 8
Nathaniel_C
Community Champion
Community Champion

Hi @Danbert ,
Would you copy and paste your first table right into the message so that we can copy and paste it into Power Query? Cannot do that  with pictures.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @Nathaniel_C , of course, sorry about that.  Please see below:

 

UserTimerLogDurationJobTypeJobTypeID
John Smith50Billable1
Dave Brown100Non-Billable2
Mary Jones15Billable1
John Smith150Billable1
John Smith200Absent3
Sally Wood27Non-Billable2
Frank Walston35Billable1
Sally Wood84Absent3
Frank Walston94Non-Billable2

Hi @Danbert beat you to it with a dummy table. Let me know if this makes sense.😁





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @Danbert 
Using your table. pivot 2345.PNG

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@Nathaniel_C  - that worked perfectly, thanks so much that's saved me a lot of time!

Hi @Danbert ,

You are very welcome, glad to help!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@Nathaniel_C, thanks so much for coming back to me so quickly on this.  I won't be able to test this until tomorrow but looks exactly like what I'm after.  I'll report back tomorrow.

Thanks again.

Hi @Danbert ,

Dummied up a table for you, you will end up with a table like this by selecting the Type Column and Selecting Pivot on the Transform tab. Use Time as the values.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathanielpivot 234.PNG

 







pivot 23.PNG

 The picture below shows both the selection for Pivot Column and the resulting table.

pivot 2.PNG

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors