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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
asdf1608
Helper V
Helper V

SVG Stacked bar in Matrix Visualization

I need to combine a matrix visualization with the measure values as Stacked bar in Power Bi.

I tried to use two different charts but the format is not same. So trying to use SCG Stacked bar chart for three columns

1)a = MIN(Column1)

2)b = MIN(Column2)

3)c = MIN(Column3)

How do I create a SVG to display the bars like this

asdf1608_0-1679036367420.png

Help in this is needed

20 REPLIES 20
asdf1608
Helper V
Helper V

@lbendlin Any update on this?

no, still learning how to use VCONCAT properly in Deneb, and how to translate that the SVG code.

@lbendlin Thank you for your effort. I tried to get in other ways the stacked bar chart in matrix visualization. Still nothings. So the only possibility is SVG in which I need help

Looking at the data again I still see negative profit numbers. I think a clustered column chart is more appropriate for that to display.

 

lbendlin_0-1680215102387.png

 

@lbendlin I can't use that because we need the data to be in table format and the measure values to be in bar chart. 

lbendlin
Super User
Super User

You hand craft the SVG code for that type of visual (including the rendering of the Y axis and the calculation of the Y offset for the bars) and then you present that SVG to the image in the matrix cell.  

 

Start with sample data and create the SVG for the desired output. Then make the parameters dynamic.

@lbendlin Yes I tried to do that but I am not getting in stacked bar and I couldn't find any samples for stacked bar. Can you refer any stacked bar SVG .

 

Please help this is an emergency

Please provide sanitized sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

@lbendlin I need to display a matrix with three values in stacked bar chart. 

For Example:

asdf1608_1-1679402923298.png

 

Here in table format the measure values "Profit", "Calculation1"and "Quantity" are in stacked bar.
I need the same thing in power BI. This is possible thorough SVG. But I am not getting any sample for this.
Can you give idea to get this stcaked bar?

I can work on it if you provide usable sample data.

@lbendlin Yes. This is the sample data
Book1.xlsx

PBI File: sample.pbix

thank you for the sample data.  I assume you are stacking something by customer,segment, and date.  But what are you stacking? Quantity and Profit ratio have different units of measure?

Then you can use "Sales and "Profit". It is just we need to stack bar in matrix visualization

There's a small problem 🙂  Some sample customers have negative profit ...  

 

lbendlin_1-1679420789862.png

 

That means there has to be additional logic (across ALLSELECTED) to find the largest positive and the largest negative value in order to define the Y axis range.

 

@lbendlin Can you please send the PBIX file so that I can refer

I haven't done any SVG work yet, waiting for your guidance. The example was based on Small Multiples.

 

 

@lbendlin Thank you for for help until now. I have updated the PBIX file. Here there are no negative values and you can refer page1 for the fields to be used for the stacked bar chart in SVG.

Can you please try in this and get the stacked bar chart

sample.pbix

@lbendlin Can you please look into it ans get me the stacked SVG Barchart. I am still struggling to get it correct. 
Help from you will be appreciated.
Thanks

@lbendlin any luck? I need this Stacked SVG Bar. Help in this is really needed

@lbendlin  is this possible in svg. I tried it but didn't get what needed.

have you tried it?

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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