Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.
"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
Solved! Go to Solution.
Hi @PowersBI ,
I made simple samples and you can check the results below:
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.
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.
Hi @PowersBI ,
I made simple samples and you can check the results below:
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.
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |