cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Saniat
Helper IV
Helper IV

100% stacked bar chart - Y axis - max area width - can I fix the width

Hi,

I am using a 100% Stacked bar chart, together with separate "total%" of it:

Saniat_2-1669800803901.png


I have played around with the Y-axis: max area width, but as we can only play around with the MAX width, and cannot FIX it, I am facing problems when I am breaking down on different dimension, e.g.:


The detailed chart starts before the Total when Y axis label is shorter:

 

Saniat_1-1669800742411.png

 

The detailed chart starts after the Total when Y axis label is longer:

Saniat_3-1669801320535.png


This problem is based on the assumption of: We can only play around with the MAX width of Y-axis label, and cannot FIX it.

Is there any way to FIX this width - so I know exactly where the viz starts, and align the Total chart ?

Thanks.

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Saniat 

 

Create a disconnected table with all the categories and a row with the total:

MFelix_0-1669808120384.png

 

Then add the following metric:

Total values =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table (2)'[Cat] ) = "Total", SUM ( 'Table'[Value] ),
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( 'Table', 'Table'[Cat] IN DISTINCT ( 'Table (2)'[Cat] ) )
    )
)

 

Now use this metric and the new table on the visual.

 

MFelix_1-1669808182603.png

If you want you can add a sort id on the table so you have the values of the category in the correct order.

 


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

1 REPLY 1
MFelix
Super User
Super User

Hi @Saniat 

 

Create a disconnected table with all the categories and a row with the total:

MFelix_0-1669808120384.png

 

Then add the following metric:

Total values =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table (2)'[Cat] ) = "Total", SUM ( 'Table'[Value] ),
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( 'Table', 'Table'[Cat] IN DISTINCT ( 'Table (2)'[Cat] ) )
    )
)

 

Now use this metric and the new table on the visual.

 

MFelix_1-1669808182603.png

If you want you can add a sort id on the table so you have the values of the category in the correct order.

 


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



Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors