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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
DarrenW
Frequent Visitor

Line charts - hiding a reference to a data series in the legend when there is no data

I have a dataset which I need to show on a line chart.  It consists of a date/time element (shown on X axis) and up to 3 series.  The data represents several monitoring sites which may have up to 3 types of data associated on this chart.

The data is filtered via a slicer in order to allow the user to choose the site shown but not all sites have all 3 types of data available.  Obviously, if there is no data for one of the series, nothing can be shown on the chart, but the series is still represented in the legend, since the column the data would be contained in is still part of the dataset.

Somehow, I'd like to hide the name of the series with no data in the legend, as I think it has the potential to confuse users.  I can't see a way of dynamically hiding the legend so I'm wondering if maybe you could achieve the result via hiding columns (I have considered whether or not you could reproduce the table using dax and only represent columns that have data under the current filter conditions but am not 100% sure how to do this)

Does anyone have any suggestions or is this something we're going to have to live with?

4 REPLIES 4
DarrenW
Frequent Visitor

I should also add that I've tried unpivoting the data but that doesn't work since the 'event period' series needs to be on the secondary y axis.  Leaving that column out of the unpivot doesn't work either, as it's impossible to drag or otherwise force the series onto the secondary Y

amitchandak
Super User
Super User

@DarrenW , I checked out my data. When the data is blank it does not show the legend. Make sure is blank, not 0

Avoid any +0 or coalesce or null/blank handing

 

amitchandak_0-1664181073275.png

 

amitchandak_1-1664181087355.png

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

This did not answer my question

I'm not seeing this behaviour on a line chartUntitled.png.  See screen shot.  Outfall Depth column has no data.  there are zeros in the data and they are displayed as expected (and I need them to be)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors