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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
FARYAL
Frequent Visitor

Dynamic Legend via Slicer in Power BI live connection

Hello All,

 I have been desperately trying to make a legend in bar chart visual since 2 weeks now. As I am working in live connection. A friend already has a solution but unwilling to share.

 

 I have tried alot but going no where. I can't use Bookmarks or page navigation.

 

I want legend to not display is nothing is selected and display if something is selected.

 

I have created a workaround on visual display by using is filtered dax and it is somewhat working but with this approach I am facing the issue if tool tip not being displayed on second visual because it is positioned after the first visual at the same spot.

 

 

 

 

 

 

Can I please have a solution?

 

Regards 

Faryal

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @FARYAL 
You can use a workaround by adding shape and conditional formatting.

Create a Dax measure with the code like :

legend_f = if (ISFILTERED('Table'[Teams]),"#FFFFFF00","#FFFFFF")
(in your case you need the color codes of your background)
add a small shape in place of the legend:
Ritaf1983_0-1700714600131.png

switch off the border and use the Dax that we created for a fill of the shape

Ritaf1983_1-1700714852565.pngRitaf1983_2-1700714888239.png

result:

Ritaf1983_3-1700714928120.png

Filtered:

Ritaf1983_4-1700714961435.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

2 REPLIES 2
FARYAL
Frequent Visitor

@Ritaf1983 Thank you for your help it worked in normal circumstances. However, with me the graphs presentation was also different. Like one was wih multiples and other were without. 

 

So to hadle the tool tip issue I actually created a page navigation with corresponding tables and used a information icon to navigate to the page and it worked for me.

 

I really appreciate your help.

 

Regards Faryal

Ritaf1983
Super User
Super User

Hi @FARYAL 
You can use a workaround by adding shape and conditional formatting.

Create a Dax measure with the code like :

legend_f = if (ISFILTERED('Table'[Teams]),"#FFFFFF00","#FFFFFF")
(in your case you need the color codes of your background)
add a small shape in place of the legend:
Ritaf1983_0-1700714600131.png

switch off the border and use the Dax that we created for a fill of the shape

Ritaf1983_1-1700714852565.pngRitaf1983_2-1700714888239.png

result:

Ritaf1983_3-1700714928120.png

Filtered:

Ritaf1983_4-1700714961435.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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Kudoed Authors