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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

How to hide legend of a stacked column chart

Hi everyone,

 

i have been stuck with an issue on my stacked column chart:

 

The context:

 

I have a database and from that database I created the attached visual.

 

The problem:

When I filter on some specific projects, it happens that there is still the full legend (let's say 15 items) whereas for the chart displayed there are only 5 items over these 15

 

What I am trying to do:

I would like that, whenever I am filtering of any project, that the legend becomes the appropriate one (i.e., only the value concerned, not the full legend)

 

Do you have any idea on how I could do that?

 

I have been through Google but nothing worked for my case.

 

Wishing you all a great weekend,
lucasPicture 1 chart.png

3 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @Anonymous 
We don't have this functionality built-in, but you can achieve it by generating the legend by yourself with conditional formatting. 

Ritaf1983_0-1705689053178.png

To achieve it i created a small table with blank value:

Ritaf1983_1-1705689130925.png

measure for conditional formatting according to the graph's color

Ritaf1983_2-1705689186047.png

used it to have cells by these colors :

Ritaf1983_3-1705689261973.png

switched off all elements of a table like grides / lines 
added a text box with a title to avoid place problems
and grouped everything together

Ritaf1983_4-1705689416733.png

Result with filtering :

Ritaf1983_5-1705689485979.png

pbix is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Anonymous
Not applicable

Thanks for your answer, helps a lot!

View solution in original post

Hi @Anonymous 

Happy to help please accept my response as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @Anonymous 
We don't have this functionality built-in, but you can achieve it by generating the legend by yourself with conditional formatting. 

Ritaf1983_0-1705689053178.png

To achieve it i created a small table with blank value:

Ritaf1983_1-1705689130925.png

measure for conditional formatting according to the graph's color

Ritaf1983_2-1705689186047.png

used it to have cells by these colors :

Ritaf1983_3-1705689261973.png

switched off all elements of a table like grides / lines 
added a text box with a title to avoid place problems
and grouped everything together

Ritaf1983_4-1705689416733.png

Result with filtering :

Ritaf1983_5-1705689485979.png

pbix is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Anonymous
Not applicable

Thanks for your answer, helps a lot!

Hi @Anonymous 

Happy to help please accept my response as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

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.