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
badger123
Resolver I
Resolver I

Top n by date

I’m using a ribbon chart visual to show the top items over time by volume. Is there a way to show the top n at each date, rather than the top n over the entire period?

E.g. top 10 in each given month, rather than top 10 based on the entire period (even if it isn’t in the top 10 in a given month).
2 REPLIES 2
v-danhe-msft
Employee
Employee

Hi @badger123 ,

Based on my test, you could refer to below test:

Sample data:

1.PNG

Create below measure:

Measure = COUNTROWS(FILTER(ALL(Table1),'Table1'[Legend]=MAX('Table1'[Legend])&&ISONORAFTER('Table1'[Value],SELECTEDVALUE(Table1[Value]),ASC,[Date],SELECTEDVALUE(Table1[Date]))))

And set the measure in filter with below condition:

2.PNG

Result:

3.PNG

You could also download the pbix file to have a view.

 

Rrgards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-danhe-msft  - this is really helpful! I can't seem to apply it to my own use case and get it to work. Here is a bit more information about my tables and desired output:

 

Table 1  
DatePhraseValue
Jan-19phrase 110
Jan-19phrase 220
Jan-19phrase 330
Jan-19phrase 440
Jan-19phrase 570
Feb-19phrase 1100
Feb-19phrase 230
Feb-19phrase 320
Feb-19phrase 410
Feb-19phrase 55
Mar-19phrase 1150
Mar-19phrase 220
Mar-19phrase 330
Mar-19phrase 440
Mar-19phrase 5200

 

Table 2 
PhraseLegend
phrase 1Category A
phrase 2Category B
phrase 3Category B
phrase 2Category C
phrase 4Category C
phrase 5Category D
phrase 3Category E

 

Current approach: Tables 1 and 2 are connected by phrase. I am using the categories as the legend and summed values as the value. I'm currently using a top n filter (e.g. top 2) which is showing the top 2 based on total value over the entire period. 

 

Ribbon Chart.PNG

 

Desired output: What I'm trying to do is show the top n at each given date. So based on the sample of tables I shared, this would look something like: 

 

DateTop 2Total Value
Jan-19Category D70
Jan-19Category C60
Feb-19Category A100
Feb-19Category B50
Mar-19Category D200
Mar-19Category A150

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.