Forum Discussion

FARYAL's avatar
FARYAL
Frequent Visitor
2 years ago
Solved

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 ...
  • Ritaf1983's avatar
    2 years ago

    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:

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

    result:

    Filtered:

    Pbix is attached

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

    members find it more quickly