Forum Discussion

Amos_Lim's avatar
Amos_Lim
Icon for Resolver I rankResolver I
2 years ago
Solved

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.

  • 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

  • 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's avatar
      Amos_Lim
      Icon for Resolver I rankResolver 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's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        I have assumed that AC,O,FS,DS are in the Area column of the Table.  chenge that accordingly to your data.

  • 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.