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
powerJR88
Frequent Visitor

Add country as a stack in clustered column chart

Hi, 

 

I have two clustered column charts with metrics from FY21, FY22 and Projected Year. I need to add a country column to the chart where it shows which portion of a particular month is US and the other portion is India. But I am not able to add it to the legend. 

 

This is what I have so far.

powerJR88_0-1731625696691.png

 

I would like to be the clustered chart somewhat close to this. 

powerJR88_1-1731625764529.png

Where you can see that in the month September, the bottom portion is India and the top portion is the US.

 

 

Let's say I add the Country column to the graph:

powerJR88_2-1731625921274.png

It'll be part of the X-Axis, but what I am looking for one single bar with 2 stacks: 1 showing India and 1 showing US like the other example in light green and blue.

 

Appreciate your help in this matter.

 

1 ACCEPTED SOLUTION
powerJR88
Frequent Visitor

With the help of a colleague, I realized I just needed to create a couple of appends with FY21, FY22 and Projected Results. I merged the Total Hours (FY21 and FY22) and Hours (Projected Results) into one column, Total Cost (FY21/FY22) and Cost (Projected Results) into another column, and the Ranks into another column. I created a new column called Fiscal Year which differentiated between the year. Then I was able to combine the visuals together.

 

powerJR88_0-1732111670156.pngpowerJR88_1-1732111696561.png

I'm good for now.

View solution in original post

4 REPLIES 4
powerJR88
Frequent Visitor

With the help of a colleague, I realized I just needed to create a couple of appends with FY21, FY22 and Projected Results. I merged the Total Hours (FY21 and FY22) and Hours (Projected Results) into one column, Total Cost (FY21/FY22) and Cost (Projected Results) into another column, and the Ranks into another column. I created a new column called Fiscal Year which differentiated between the year. Then I was able to combine the visuals together.

 

powerJR88_0-1732111670156.pngpowerJR88_1-1732111696561.png

I'm good for now.

powerJR88
Frequent Visitor

Thanks @v-yohua-msft, but I don't think your solution will help.

 

I have imported 5 tables into Power BI and I am using these tables to do my analysis. 1st table is FY21, 2nd table is FY22, 3rd table is combined FY21&FY22, 4th table is an unpivoted table of projected results and 5th table is the full projected results.

 

This group below utilizes the Combined FY21&FY22 and full projected results tables: 

powerJR88_0-1731678396417.png

Whereas this graph has the FY21, FY22 and unpivoted Projected table:

powerJR88_1-1731678465239.png

So, how do I put these two graphs together where I can see which portion is US and which portion is India?

 

If you want me to share each table view, please let me know.

Thejeswar
Community Champion
Community Champion

@powerJR88 ,

This is because you are using a Clustered Column chart and trying to add a Stacking to it as in case of Stacked Bar chart.

 

I think the solution suggested by @v-yohua-msft , would be the appropriate one for this

v-yohua-msft
Community Support
Community Support

Hi, @powerJR88 

Based on yur information, I create a sample table:

vyohuamsft_0-1731659070692.png

 

Then create a stacked column chart, put Date month in X-axis and put FY-21 in Y-axis. Put Region in Legend.

Here is my preview:

vyohuamsft_1-1731659363482.png

However, the data source can only put one value from FY-21, FY-22, and Projected Year on the Y axis

If your data is similar to my example and you want to display all three values, you can Unpivot the three columns FY-21, FY-22, and Projected Year in PowerQuery. I create another table and a new page.

vyohuamsft_2-1731659925762.png

vyohuamsft_4-1731659983033.png

 

Then select Close and Apply. Create stacked column chart and put fields like the following preview:

vyohuamsft_5-1731660122132.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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.