Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi!
I have over 45 items on my legend on a clustered bar chart, and all of them show up when the chart if displayed. Wehn I use a Year/Month filter to filter down the rcords , is it possible to show the legends for only those items that appear on the bar, right now it shows up all the lengends and that too not full information .
I'm not sure what you mean, are you please able to provide more details and maybe photos?
The legend should dynamically update with the chart unless you have asked it not to.
Are you using a Year Filter or a Year Drilldown?
Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos.
I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query.
https://sites.google.com/site/allisonkennedycv
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
I am using a clustered chart which displays number of items, by Year/month and category of item. The Category of items are around 45 categories and that is the legend. In the legend it shows which color code the item is , since there re more than 45 categories , it does not fit all in one screen , so what I want to do is , when I use my Year/month filter on the report not drill down, basically it should remove all the categories that does not fall in that month /year , so only the legends corresponding displays on the report.
How many categories fall in a given month? I'm still unclear why it's not working. Are you able to share a sample file via OneDrive link please?
Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos.
I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query.
https://sites.google.com/site/allisonkennedycv
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
I was talking about the legend at the bottom of the screen, which shows all of them even when I use my Year/month filter, I want it to show only the ones that fall within that range.
So for example if you narrow down to 2021 October, what does it look like?
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
The legend at the bottom still displays all the items .
Sorry @Anonymous but we'll need a lot more information to help you out in this case, as this is not standard behaviour.
If the total graph has been filtered, the legend should filter also as per my screenshot here. You can see the chart on top with no filter, and the chart below with filter. Legend has automatically updated.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Thanks Allison. I agree it should should filter out the legends as well and it does in my case as well when I use the Category filter, it does filter the lengends as well at the bottom , but when I filter by Year/month, that is when it stays the same.I get the entire list showing up on the legend.
Thanks
@Anonymous
Right click Legend and deselect "Show items with no data". Besides, use measure below to deal with zero.
Measure 2 =
IF ( [Measure] = 0, BLANK (), [Measure] )
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.