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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Zoom in on 100% stacked bar chart or use percentage of total but filter values displayed

Hi. I have a 100% stacked bar chart that looks like this:

petermah_0-1642720708501.png

 

I would like it to just focus on the two green values so it looks like this:

petermah_1-1642720767835.png

 

*But* I want to keep the percentages (percentage of the whole group) from the first chart. So for the left bar instead of 13% and 87% it should be 3% and 21%.

 

Basically something like zooming in on the chart or only showing the parts of the chart above 70%.

 

Is there a way to acheive this with Power BI?

 

Thanks

 

 

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try to use ALL function.

Here's a simple example.

Percentage = DIVIDE(SUM('Table'[Value]),SUMX(ALL('Table'),[Value]))

vstephenmsft_0-1643101992852.png

vstephenmsft_1-1643102004562.png

 

 

Best Regards,

Stephen Tao

 

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

 

View solution in original post

6 REPLIES 6
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try to use ALL function.

Here's a simple example.

Percentage = DIVIDE(SUM('Table'[Value]),SUMX(ALL('Table'),[Value]))

vstephenmsft_0-1643101992852.png

vstephenmsft_1-1643102004562.png

 

 

Best Regards,

Stephen Tao

 

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

 

parry2k
Super User
Super User

@Anonymous so if I understood correctly, you want the remaining portion to be filled with others to make it 100%, in the screenshot, the first bar currently shows 21% + 3 %, and the remaining 76% and in the 2nd bar it will be 67%, is this what you are looking for? 

 

 



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.

parry2k
Super User
Super User

@Anonymous what is the error?

 

 



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.

Anonymous
Not applicable

There were no errors but it just wasn't ignoring the filter. It seemed to have to do with the legend column being a calculated column. It was actually a calculated column that used other calculated columns. It went about 4 levels deep.

 

I changed all the columns to do their calculations in the transform so now it is a regular column and REMOVEFILTERS now works as expected.

 

The last part of the puzzle is if I can use the percentage of the unfiltered totals in a 100% stacked chart to even out the visual. Maybe it is better if it isn't but I am curious if there is a way to do it. Right now if I just use a stacked chart I get:

 

petermah_0-1642996487072.png

 

If I change it to a 100% stacked chart it automatically changes the percentages accordingly which is what I would expect but not what I want to see in this case:

 

petermah_1-1642996571283.png

 

If it can't be done I should still be OK. Thanks for sending me down the right path.

parry2k
Super User
Super User

@Anonymous write a measure and use that in the visual:

 

Fixed % = 
DIVIDE ( 
    [Your measure currently on the value], 
     CALCULATE ( [Your measure currently on the value], 
       REMOVEFILTERS ( Table[Column used on the legend] ) 
    ) 
)

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



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.

Anonymous
Not applicable

Thanks. I am having problems with REMOVEFILTERS not working though. I think it might have something to do with the field being used in the legend is a calculated column (also derived from another calculated column).

 

If I try to remove the filter on that Calculated column it does not seem to do anything. If I remove the filter on the native column of the table which I am grouping by (each group gets an individual bar), it removes that filter successfully but that is not what I want.

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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