Forum Discussion
Top 5 won't work when filter catergory selected
I have a chart that shows the top five.
When no filter is selected, it works flawlessly.
When a filter was applied, however, instead of showing the top 5, it displayed the top 6.
Please see below the 2 photos with and without filter selected.
How can I ensure that it never exceeds 5?
Need help! please. Thanks.
Hi,
There is a tie at the 5th place - that's the reason you see 6 rows. PBI file attached.
Thank you so much, Ashish Mathur.
I tested it on more data sets and it seemed to work.
I'll run another test on my master file.
9 Replies
- Ashish_Mathur
Super User
Hi,
Try these measure patterns
Count = counta(Data[Subsystem])
Top 5 = calculate([Count],Topn(5,all(Data[Area]),[Count]),values(Data[Area]))
Area is what i see in the legend of the pie chart. Drag he Top 5 measure to the visual.
Hope this helps.
- Amos_Lim
Resolver I
Hello, Ashish_Mathur.
I was able to get the first measure, Count = counta(Data[Subsystem]), to work.
In the second part, you mention noticing the "Area" in the pie chart's legend? There wasn't any Area in my chart. could you clarify?
- Ashish_Mathur
Super User
I have assumed that AC,O,FS,DS are in the Area column of the Table. chenge that accordingly to your data.
- Amos_Lim
Resolver I
Thank you so much, Ashish Mathur.
I tested it on more data sets and it seemed to work.
I'll run another test on my master file.
- Ashish_Mathur
Super User
You are welcome. Please mark my reply as Answer.