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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
gboierocd
New Member

How to create two stacked bars (Sales and Expenses) by country in Power BI

Hi community!
I’m trying to create a Power BI chart where, for each month, I can display two bars:

One bar for Sales (stacked by Argentina and USA).

Another bar for Expenses (also stacked by Argentina and USA).

The goal is to have both bars side by side for each month — something like this example:

 

screenshot_graph_sale_expense.png

I’ve tried using the stacked bar/column chart, but it only allows me to show one category at a time (e.g., only Sales or only Expenses).

Does anyone know how to set it up so that both (Sales and Expenses) can appear stacked and grouped by month in the same visual?
Ideally, without having to use two separate charts.

Thanks in advance for your help!

 

2 ACCEPTED SOLUTIONS

Thank you very much for your help! 🙌
Your example was very clear, and I’ll definitely try your workaround to see how it works in my case.

Just one question — is there a way to make the Expenses columns appear in a different color from the Sales columns?

View solution in original post

That option should be under the legend. That aside, please mark my post as a solution.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

8 REPLIES 8
srlabhe
Resolver IV
Resolver IV

To create a stacked bar chart of Sales and Expenses by Country in Power BI, select the "Stacked column chart" visual, drag the "Country" field to the X-axis, drag both "Sales" and "Expenses" to the Y-axis, and then drag "Sales" and "Expenses" to the Legend to stack them.  
 
Step-by-Step Guide 
 
  1. Add a Stacked Column Chart: From the Visualizations pane, select the "Stacked column chart" visual.
  2. Populate the X-axis: From your data pane, drag your "Country" column to the X-axis field well.
  3. Add the Measures:
    • Drag your "Sales" measure to the Y-axis field well.
    • Drag your "Expenses" measure to the Y-axis field well.
  4. Stack the Bars: Drag both the "Sales" and "Expenses" fields (or their corresponding measures) into the Legend field well.
This setup will create bars for each country, with each bar divided into segments representing the Sales and Expenses for that country
danextian
Super User
Super User

Hi @gboierocd 

Use a disconnected table to materialize the result of your measures in a column

danextian_0-1759838080609.png

Use the Measure column as a category together with the months with the Country column as legend.

danextian_2-1759838177262.png

 

Please see the attaches sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thank you very much for your help! 🙌
Your example was very clear, and I’ll definitely try your workaround to see how it works in my case.

Just one question — is there a way to make the Expenses columns appear in a different color from the Sales columns?

That option should be under the legend. That aside, please mark my post as a solution.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
grazitti_sapna
Super User
Super User

Hi @gboierocd,

You can use Custom visual like Stacked and Clustered Column Chart” (by Daniel Marsh-Patrick, or similar).

 

Another Option if you don't want to use custom visual

 

You can Transform your table so that Sales and Expenses become rows instead of separate columns (i.e., unpivot them).

 

Now you can place the value as 

In Power BI:

  • Axis: Month

  • Legend: Type (Sales / Expenses)

  • Stacked by: Region

  • Values: Value

to get side-by-side bars per month, use the small multiple trick or Combo chart workaround

Create a Clustered Column Chart and set Type (Sales/Expenses) as “Small multiples”.

 

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!

Thank you for your quick reply!

Unfortunately, the “Stacked and Clustered Column Chart” visual by Daniel Marsh-Patrick doesn’t seem to be available anymore in AppSource.

I also tried the “Small multiples” approach, but it separates the visuals instead of keeping the bars side by side, so it doesn’t allow for an easy comparison.
Thanks!!

 

Shivu-2000
Responsive Resident
Responsive Resident

Hii   @gboierocd

You can use  Field Formatting + Unpivoted Data for your visual.

You will have to make changes in your underlying data structure in unpivoted format, Post that you can use a Clustered Column Chart

  • Go to Visualizations pane.

  • Use the Clustered Column Chart.

Field Place into
Month X-axis (Shared Axis)
Value Y-axis (Values)
MeasureType Legend (for grouping: Sales vs Expenses)
Country Column Series (for stacking inside each bar)

 

 

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

Thank you for your suggestion!

In my case, the data is calculated dynamically, so I’m not able to unpivot or restructure it in Power Query.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.