Forum Discussion

kjartank's avatar
kjartank
Icon for Helper II rankHelper II
9 years ago
Solved

Measure that filters by 10 highest values

I have a table with a column that is used as an identifier. The tables that I make on the two first pages are only supposed to show the 10 highest values from that column, i.e the 10 most recent rows. How would I go about writing a measure that only shows the 10 highest values, so I can put the measure as a pagewide filter?

  • You might need to post an example of the data so that we can understand exactly what you are looking for. But I think you're looking to rank members of a table by a measure. For example, you're looking to get the top 10 sales reps by total sales? Is that correct?

     

    If so, the easiest way to do this would be to make your table visual in Power BI then look at the "filters" area on the right. Under "Visual Level Filters" there should be the attribute you have in the rows of your table. Hover over this attribute and hit the minus sign. This will display the filter options. From the drop down list, select "Top N" and then under that select the number of items you want to show and the value you want to filter on, usually the same value you are showing in your table.

5 Replies

  • You might need to post an example of the data so that we can understand exactly what you are looking for. But I think you're looking to rank members of a table by a measure. For example, you're looking to get the top 10 sales reps by total sales? Is that correct?

     

    If so, the easiest way to do this would be to make your table visual in Power BI then look at the "filters" area on the right. Under "Visual Level Filters" there should be the attribute you have in the rows of your table. Hover over this attribute and hit the minus sign. This will display the filter options. From the drop down list, select "Top N" and then under that select the number of items you want to show and the value you want to filter on, usually the same value you are showing in your table.

    • kjartank's avatar
      kjartank
      Icon for Helper II rankHelper II

      TheOckieMofo

       

      Thanks a lot! I have never noticed the Top N before, but it does what I need. Sorry for the inconvenience.

      • TheOckieMofo's avatar
        TheOckieMofo
        Icon for Resolver II rankResolver II

        No worries. It's actually a fairly new feature. You can accomplish the same thing with dax, but it takes two measures and is definitely not as straightforward.

  • CahabaData's avatar
    CahabaData
    Icon for Memorable Member rankMemorable Member

    the community probably needs clarification in your post

     

    are these IDs sequential integers such that the correct candidates are MAX to MAX - 10

     

    or are these IDs something else....and how is the correct set of 10 logically defined?

    • kjartank's avatar
      kjartank
      Icon for Helper II rankHelper II

      Hi CahabaData

       

      Yes, these IDs are sequential integers so the correct candidates are MAX to MAX -10.

       

      I put the column just below here.

       

      ID

      1601
      1602
      1603
      1604
      1605
      1606
      1607
      1608
      1609
      1610
      1611
      1612
      1613
      1614
      1615
      1616
      1617
      1618
      1619
      1620
      1701
      1702
      1704
      1705
      1706
      1707
      1708
      1709
      1710
      1711
      1712
      1714