Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I have a Line and stacked column chart with 1 column series and 4 line series.
When one of the line series measures returns all blanks, there is no line visible - good, that is what I want.
But I also want the line series to not appear in the legend when there is no line visible.
How can I achieve this?
Hi @Anonymous ,
By my test, I'm afraid you can't do it directly. Here's the workaround.
1.Create a card visual, then create a measure like below, put the measure in it and turn off the category label.
Card = ""
2.Create a color measure.
Color =
VAR _V =
IF ( MAX ( 'Table'[Column5] ) = BLANK (), 1, 0 )
RETURN
"RGBA(255, 255, 255, " & _V & ")"
3. Use the color measure in the card background color conditional formatting like this.
4.Put the card visual on top of the Column5.
When there is blank of Column5, it display like this:
When there're values in Column5, it will appear.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-yanjiang-msft thanks for the suggestion. I already know how to use this "rectangle color background to show/hide visuals" method. It would work in the case there is one legend entry to hide, but in my case I have two legend entries to hide. Hiding them would leave the remaining visible legend entries misaligned with a gap in between.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
84 | |
69 | |
68 | |
39 | |
37 |