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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jdriscoll
Helper I
Helper I

Top N By Month, New N Each Month

Hi,

 

I have a chart that looks like the following:

jdriscoll_0-1679009576439.png

 

I'm trying to show the top 5 per month (changing month to month), but the visual filter is only able to rank top 5 for the entire period on the chart. Is there a quick measure I can throw together to drop into the legend field here that would allow for a different 5 for each month?

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

I am not sure how much i can help but i would like to try.  Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

The file is linked here. Thank you.

amitchandak
Super User
Super User

@jdriscoll , Simply use TOPN measure on legend

Sumx(keepfilters(TOPN(5,allselected(Table[Fruit]), calculate(Sum(Table[NumSales])), desc)), calculate(Sum(Table[NumSales])))

 

refer to check both TOPN and Window

Dynamic TOPN using TOPN/Window and Numeric parameter: https://youtu.be/vm2mdEioQPQ

 

Thank you for that. I tried it, but unfortunately the Legend field won't accept my new Top5 measure. See below.

 

jdriscoll_0-1679021107017.png

This is the same issue I've been having with other measures I tried to create and use for the Legend.

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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