Forum Discussion

joschultz's avatar
joschultz
Advocate II
10 years ago
Solved

Top 15 in a report

What is the easiest way to show just the top 15 items in a report?  Example is I want to show the top 15 products in sales for the day.  I will have hundreds of products in the data but only want the top 15.

 

Thank you,

 

Joseph

  • kcantor's avatar
    kcantor
    10 years ago

    I use the Rank X measure for my products in the filter area of the visual (or whole page as needed). Then, when I add other values, there is nothing to break. I don't put the Rank X in the visual, I just use it as a filter for the page/report. In fact, I usually fill in all other information then apply it last to pull up my top 25.

25 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    joschultz 

    JenUnderwood just shared this solution in a different forum. You can accomplish this by building a set of dax measures which allows you to accomplish this.

    Build the measures, and use product and (Units Sold Top 15 Product) in your visual and it will automatically select the top 15 products based on sales numbers (or whatever you want to use in the measure to calculate by)

     

    Example:

    Units Sold Total = SUM(table[Product Sales])
    Units Sold Rank by Product = RANKX(ALLSELECTED(table[Product]), [Units Sold Total])
    Units Sold Top 15 Product = IF([Units Sold Rank by Product] <= 15, [Units Sold Total])

    • joschultz's avatar
      joschultz
      Advocate II

      Do I build them as measures or fields?  I tried measures but I wasn't able to get it to work.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Measures...

        What is not working? the measures, or the visuals?

  • Use RANKX in a measure to get rankings numbers for the particular value and then drop the measure in one of the filter areas and apply less than or equal to 15 or whatever top x you are after.