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
I have a table that has the following information (Month Year is connected to a date dimension):
Month Year Category
Jan 2018 A
Jan 2018 A
Jan 2018 B
Jan 2018 C
Jan 2018 C
Feb 2018 D
Feb 2018 B
Feb 2018 B
Feb 2018 D
Feb 2018 D
What I am trying to show is the top 2 categories for each month by count. So it would look like this:
Month Year Category Count of Category
Jan 2018 A 2
Jan 2018 C 2
Feb 2018 B 2
Feb 2018 D 3
What is making this tricky is visualizing it. In Jan 2018 we have category A & C and in Feb 2018 we have category B & D. When I try to visualize it by adding Category to the legend and selecting the Top 2 by count, it selects the Top 2 of all categories of the entire set, and not Top 2 by individual month. I understand why the bar chart visuals are behaving this way, I'm wondering if there is a work around so I can show the top categories for each month? Hopefully I have explained this so it's easy to understand the problem, but please let me know if you would like further clarification. I can also provide code of what I have attempted to do to solve this problem if you would like to. Thanks!
Hi,
I believe this is the result you want. Download the PBI file from here.
Hope this helps.
Thank you very much! I am able to actually accomplish this aspect. What I am having trouble with is visualizing this in a bar chart. For example, let say I put it into a bar chart with Month Year in the axis, Count in the values, and Category in the legend. Then I filter Category by Top 2 of Count. The bar chart will show the top 2 categories for all time only, but what I would like to visualize is the top 2 categories per month. Hopefully this clears it up.
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.