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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cake28424
Frequent Visitor

Bar Chart Legend Dependent on Filter

Hi all! Need some help with a visual:

I have a Power BI report that shows connections between companies. Each row of data features a Company column and Company partner column. I have filters for both Company and Partner Company on this page. When I filter to Company, I want the bar chart - which shows the partnering company count - to have a legend of Partner Company. When I filter to Partner Company, I want the bar chart to have a legend of Company. Goal is to show who these companies are partnering with. Due to another visual, I require both Company and Partner Company filters and aniticipate both to be used by the end user.

 

How can I make this visual work? I've taught about overlaying two bar charts, each with a different legend but do not know how I owuld hide a visual based on whether a filter is one. 

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

Hi @cake28424 

 

The proposed solution is to overlay two bar charts and dynamically display them based on the applied filter, which is a feasible approach.

 

To achieve this effect, you can utilize bookmarks and the selection pane.

 

First, create two separate bar charts. One chart will have 'Company' as the legend (to be displayed when 'Partner Company' is filtered), and the other will have 'Partner Company' as the legend (to be displayed when 'Company' is filtered).

 

Use bookmarks to capture the state of your report page for each filter scenario.

 

You'll need to create two bookmarks:

 

Bookmark 1: Hide the 'Company' legend chart and show the 'Partner Company' legend chart.

 

vnuocmsft_0-1709012785479.png

 

 

Bookmark 2: Hide the 'Partner Company' legend chart and show the 'Company' legend chart.

 

vnuocmsft_1-1709012853370.png

 

 

Use the Selection Pane: The Selection Pane allows you to control the visibility of visuals on your report page. Use it in conjunction with bookmarks to show/hide the appropriate chart based on the filter applied.

 

Create buttons. When clicked, the corresponding bookmark will be activated.

 

vnuocmsft_2-1709012970254.png

 

Here is the result.

 

vnuocmsft_3-1709013088525.png

 

vnuocmsft_4-1709013146662.png

 

vnuocmsft_5-1709013162960.png

 

Regards,

Nono Chen

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

2 REPLIES 2
cake28424
Frequent Visitor

Thank you!

v-nuoc-msft
Community Support
Community Support

Hi @cake28424 

 

The proposed solution is to overlay two bar charts and dynamically display them based on the applied filter, which is a feasible approach.

 

To achieve this effect, you can utilize bookmarks and the selection pane.

 

First, create two separate bar charts. One chart will have 'Company' as the legend (to be displayed when 'Partner Company' is filtered), and the other will have 'Partner Company' as the legend (to be displayed when 'Company' is filtered).

 

Use bookmarks to capture the state of your report page for each filter scenario.

 

You'll need to create two bookmarks:

 

Bookmark 1: Hide the 'Company' legend chart and show the 'Partner Company' legend chart.

 

vnuocmsft_0-1709012785479.png

 

 

Bookmark 2: Hide the 'Partner Company' legend chart and show the 'Company' legend chart.

 

vnuocmsft_1-1709012853370.png

 

 

Use the Selection Pane: The Selection Pane allows you to control the visibility of visuals on your report page. Use it in conjunction with bookmarks to show/hide the appropriate chart based on the filter applied.

 

Create buttons. When clicked, the corresponding bookmark will be activated.

 

vnuocmsft_2-1709012970254.png

 

Here is the result.

 

vnuocmsft_3-1709013088525.png

 

vnuocmsft_4-1709013146662.png

 

vnuocmsft_5-1709013162960.png

 

Regards,

Nono Chen

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

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.