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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
PhiBu
Helper I
Helper I

Stacked column chart in clustern column chart

Hello everyone, 

 

I would like to have a stacked column bar within my stacked column chart. Is this possible?
My goal is to compare the estimated hours and working hours in our project in a stacked bar chart. However, I want to have a stacked column for the two categories of working hours.   

I hope you can help me with that. 

Best regards!

 

Actual chartActual chart

1 ACCEPTED SOLUTION

Hi @PhiBu ,

 

Looking at you data what I did was the following:

 

  • Created a new table with the following values:
Category ID
Estimated 1
Internal/External 2

 

  • Added the folowing 3 measures:

 

Estimated = IF(SELECTEDVALUE('Selection'[ID]) = 1 ; SUM('Jira-Issues'[Estimate Time  [h]]]); BLANK())

External = IF(SELECTEDVALUE('Selection'[id]) = 2 ; SUM('Jira-Worklogs'[External Time Spent [h]]]); BLANK())

Internal = IF(SELECTEDVALUE('Selection'[ID]) = 2 ; SUM('Jira-Worklogs'[Internal Time Spent [h]]]); BLANK())

 

 

Now create a Stacked Column chart with the following setup:

  • Axis:
    • Month
    • Category
  • Values
    • Internal
    • External
    • Estimated

Final result is in attach PBIX file (file in May version of PBI).

 

Be aware that the Hierarchy on the X-Axis need to be kept due to the setup what you can due is to concatenet the labels.

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

8 REPLIES 8
MFelix
Super User
Super User

Hi  @PhiBu ,

 

Not really sure if I understand from the image what are the values to sum but the option is to do the following:

  • Create a table with the two categories you want:

Type

Estimated
Actuals

 

Now create 2 measures:

Estimated = 
IF(SELECTEDVALUE(Table[Type]) = "Estimated"; SUM(Table[Estimated]); BLANNK() )

Internal = 
IF(SELECTEDVALUE(Table[Type]) = "Actuals"; SUM(Table[Internal]); BLANNK() )

External = 
IF(SELECTEDVALUE(Table[Type]) = "Actuals"; SUM(Table[External]); BLANNK() )

 

Now just add this 3 Measures on your stack chart and you should get internal on top of external and Estimated to the side.

 

Be aware that I'm assuming that you have a colum for estimated / interal / external but can be categories you just need to redo the measures accordingly.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



amitchandak
Super User
Super User

@PhiBu , you have check for custom visual for that, I doubt anything in power bi like that

 

https://community.powerbi.com/t5/Desktop/Clustered-stacked-column-chart/td-p/75515

http://www.defteam.com/stacked-clustered-bar-chart/

https://appsource.microsoft.com/en-us/marketplace/apps?product=power-bi-visuals

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@PhiBu you can achieve this by using In-hierarchy drill down and can get you the expected output, something like this

 

image.png

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hello, 

 

Many thanks for the quick response. 
The problem is that the actuals (internal and external working times) and the estimated working hours are in different tables. For the x-axes in my diagram I use a label (string format) from the table that also contains the estimated working hours. There is a 1:n relationship between the "Estimated Hours Table" and the "Internal and External Working Hours Table".
The solution with the in-hirachie does not fit. Also the solution with @MFelix  did not work for me.
Any other ideas? I hope you can help me :).


With kind regards. 

 

 

Best regards. 

Hi @PhiBu ,

 

Using the process that I show should work but probably theres is the need to make some adjustments, can you share a mockup sample of ypur data and relationships?


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Hey @MFelix,

 

thanks for your help. It looks like that I dont have permission to upload attachments.

The data I used for my mockup sample are:

Jira-Issues

KeyMonthEstimated Time[h]
600020-May10
700020-May20
800020-May5
100020-April3
200020-April8
300020-April16

 

Jira-Worklogs 

KeyExternal Timespent[h]Internal Timespent[h]
60003 
60003 
6000 4
700010 
7000 10
7000 5
8000 5
100044
20008 
30004 
3000 8
30004 

 

I used the column key as relation and created a clustered column chart. The column Month is a sting, not a date value. The result looks like that: 
pbi.PNG
Hope you can copy these tables in MS-Excel and help me with my issue. 

 

Best regards and thanks in advance!

 

Hi @PhiBu ,

 

Looking at you data what I did was the following:

 

  • Created a new table with the following values:
Category ID
Estimated 1
Internal/External 2

 

  • Added the folowing 3 measures:

 

Estimated = IF(SELECTEDVALUE('Selection'[ID]) = 1 ; SUM('Jira-Issues'[Estimate Time  [h]]]); BLANK())

External = IF(SELECTEDVALUE('Selection'[id]) = 2 ; SUM('Jira-Worklogs'[External Time Spent [h]]]); BLANK())

Internal = IF(SELECTEDVALUE('Selection'[ID]) = 2 ; SUM('Jira-Worklogs'[Internal Time Spent [h]]]); BLANK())

 

 

Now create a Stacked Column chart with the following setup:

  • Axis:
    • Month
    • Category
  • Values
    • Internal
    • External
    • Estimated

Final result is in attach PBIX file (file in May version of PBI).

 

Be aware that the Hierarchy on the X-Axis need to be kept due to the setup what you can due is to concatenet the labels.

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



@PhiBu that' the closest you can get from standard visuals, check for custom visual if there is a visual that can meet your requirement.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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