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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Legend - Too many Values -- How to hide legend items without data for specified date range?

Hi Power Bi Community:

 

I'm using a stacked column chart with a legend.  The legend field is a parameter, so in my case I can dynamically switch it between specific project or business unit. 

 

When I have the legend selected for specific project, I receive a message "Too Many Values.  Not displaying all data.  Filter the data or pick another field."

 

If I filter to a more recent date where I would only expect to see a few projects with data, all the projects still show up in the legend.  I had stumbled on this potential solution here -- to hide legend items if there is no data, but I can't seem to get this working in either the pie chart or stacked column chart.  Is anyone aware of a solution for this issue? 

 

When I select the legend parameter field from the visual, "Show Items with no data" is already deselected.

 

The only relevant documentation I could find online was here, but I was not sure how to interpret it. 

 

https://learn.microsoft.com/en-us/power-bi/paginated-reports/report-design/visualizations/chart-lege...

 

"The legend is always connected to a series. If a legend item appears in the legend but the corresponding series is not displayed in the chart, the most likely cause is that the series does not contain any values. You must remove this series in order to remove the legend item from the legend. To remove a series from your chart, you can right-click the specified series and select the Delete Series option." 

 

Thanks in advance

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

I made simple samples and you can check the results below:

vtianyichmsft_0-1705456177190.png

 

You can change the condition to 0 or blank, depending on your actual needs

Measure = IF(MAX('Table'[Value])<>0,1,0)

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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
Anonymous
Not applicable

Thanks for providing the .pbix file.  This solution definitely works in the example you provided.  I modified your table with some extra values and dates.  Even when I remove your measure, the legend is dynamically changing and hiding items based on the date filter. 

 

I still haven't gotten it to work in my model, but you've shown me it's possible!  Thank you. 

Anonymous
Not applicable

Hi @Anonymous ,

 

I made simple samples and you can check the results below:

vtianyichmsft_0-1705456177190.png

 

You can change the condition to 0 or blank, depending on your actual needs

Measure = IF(MAX('Table'[Value])<>0,1,0)

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.