How to Get Top 10 Records in Power BI

Cody Schneider8 min read

Finding your top-performing products, most valuable customers, or most effective marketing campaigns is fundamental to making smart business decisions. Instead of getting lost in a sea of data, Power BI gives you several ways to quickly filter for your top 10 records. In this tutorial, we'll walk through three practical methods to do just that, from a simple visual filter to more powerful DAX functions.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Why Bother Focusing on the Top 10?

Pinpointing your top performers isn’t just a neat technical trick, it's a core business activity that drives strategy. The famous Pareto principle (or 80/20 rule) often applies here: a small number of inputs (like your top 20% of products) frequently account for a large percentage of outputs (like 80% of your revenue).

By identifying your top 10, you can:

  • Optimize Inventory: Stock more of your best-selling items to avoid sellouts.
  • Reward Top Talent: Recognize and learn from your highest-performing salespeople.
  • Refine Marketing Spend: Double down on the campaigns and channels that deliver the best results.
  • Improve Customer Relationships: Nurture your most valuable customers with loyalty programs and special attention.

In short, focusing on what works allows you to allocate your resources more effectively. So, let's explore how to find these key insights in Power BI.

Method 1: The Quick and Easy Way with the Filters Pane

The simplest approach for filtering a specific chart or table is to use the built-in Filters pane in Power BI. This method requires no coding and can be done in less than a minute. It's perfect for quickly answering questions in one-off reports or dashboards.

Imagine you have a bar chart showing total sales for all your products, but you only want to see the top 10 sellers. Here’s how you do it:

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Step-by-Step Instructions:

  1. Select Your Visual: First, click on the visual you want to filter (e.g., your bar chart of Sales by Product Name). This will make its fields and properties available.
  2. Open the Filters Pane: Look for the Filters pane, which is typically located on the right side of the Power BI Desktop window.
  3. Identify the Filter Field: Your visual will have fields under a section called "Filters on this visual." Find the field that represents the items you want to rank, such as Product Name. If it's not already there, you can drag your product name field from the Data pane into this section.
  4. Change the Filter Type: Click on the dropdown arrow for the Product Name filter. Under "Filter type," you'll see options like Basic filtering. Change this to Top N.
  5. Configure the Top N Filter: A new set of options will appear:
  6. Apply the Filter: Click the "Apply filter" button at the bottom of the filter card.

That's it! Your bar chart will immediately update to show only the 10 products with the highest sales. This is a fantastic, non-destructive way to filter because it only affects the selected visual, leaving other charts in your report untouched.

Method 2: Gaining Flexibility with the DAX TOPN Function

Sometimes, a simple visual filter isn't enough. You might need a reusable list of your top 10 performers that can be used across multiple visuals or in other calculations. This is where DAX (Data Analysis Expressions), Power BI's formula language, comes in handy. The TOPN function is designed specifically for this purpose.

Using TOPN, you can create an entirely new table in your data model that contains only your top 10 records. This table is dynamic and will update whenever your data refreshes.

Understanding the TOPN Function

Before writing the formula, let's break down its structure:

TOPN(<N_Value>, <Table>, <OrderBy_Expression>, [<Order>])
  • N_Value: The number of rows you want to return (e.g., 10).
  • Table: The table you're scanning to find the top records (e.g., your 'Products' table).
  • OrderBy_Expression: The calculation that determines the ranking (e.g., CALCULATE(SUM(Sales[Sales Amount]))).
  • Order (Optional): How to sort the results. For "Top N," you'll almost always use DESC for descending order (highest to lowest).
GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Step-by-Step Example: Create a "Top 10 Products" Table

  1. Create a New Table: In Power BI Desktop, navigate to the Data view (the grid icon on the left). In the ribbon at the top, select the Table tools tab and click New table.
  2. Write Your DAX Formula: A formula bar will appear. Enter the following DAX formula. This example assumes you have a 'Products' table and a 'Sales' table with a "Sales Amount" column.
Top 10 Products =
TOPN(
    10,
    SUMMARIZE(Sales, Products[Product Name]),
    CALCULATE(SUM(Sales[Sales Amount])),
    DESC
)
  1. Analyze the Formula: Let's look at what this does. We're asking for the top 10 product names (SUMMARIZE(Sales, Products[Product Name])) based on the highest sales amount (CALCULATE(...)), sorted in descending order. Using SUMMARIZE helps create a unique list of products to rank.

Once you hit Enter, a brand new table named "Top 10 Products" will appear in your Data pane. You can now use this small, efficient table to build visuals, knowing it only contains your most important items.

Method 3: The Best of Both Worlds with RANKX

What if you want to see the rank of every single product but still visually filter for the top 10? For this, the RANKX DAX function is the perfect tool. Instead of filtering out data, RANKX adds a rank number to each item based on a metric you define. You can then use this rank number in your filters.

This approach offers incredible context. You not only see your top 10 but also see what’s at rank 11 or 12, allowing you to spot items that are close to breaking into the top tier.

How to Create a Rank Measure

It's best to create this as a measure rather than a calculated column. A measure is more efficient because it's calculated on the fly based on the context of your visuals (e.g., filters for dates, regions, etc.).

  1. Create a New Measure: Right-click on your Sales table in the Data pane and select New measure.
  2. Write the RANKX Formula: In the formula bar, enter this DAX formula:
Product Sales Rank =
RANKX(
    ALL(Products[Product Name]),
    CALCULATE(SUM(Sales[Sales Amount]))
)
  1. Breakdown of the Formula: RANKX iterates through a table, performs a calculation for each row, and then assigns a rank. The ALL(Products[Product Name]) part is crucial, it tells Power BI to ignore any initial filters on the product name and consider all products when creating the ranking.
GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Applying the Rank Measure to a Visual

Now that you have your Product Sales Rank measure, you can use it in a visual.

  1. Create a table visual on your report canvas.
  2. Add the following fields: Product Name, your Total Sales measure, and your new Product Sales Rank measure.
  3. Sort the table by the Product Sales Rank column by clicking its header. You’ll see a list of all your products, each with a rank.
  4. With the table selected, go to the Filters pane. Add your new Product Sales Rank measure to the "Filters on this visual" section.
  5. Set the filter type to "is less than or equal to" and enter 10.

You now have a table showing just your top 10 products, ranked accordingly. This combined method gives you the power of DAX with the interactive simplicity of the Filters pane.

Which Method Should You Choose?

Choosing the right method depends on your goal:

  • Use the Filters Pane: For quick, on-the-fly filtering on a single chart without complexity. It's the best option for beginners and simple dashboards.
  • Use TOPN Function: When you need a permanent, reusable table of your top N records in your data model. Best for developers who want to optimize performance by using a smaller, pre-filtered table.
  • Use RANKX with a Filter: When you need to display the rank itself or want more filtering flexibility. It provides useful context by letting you see how close other items are to the top 10.

Final Thoughts

Filtering for the top 10 records in Power BI is a great way to cut through the noise and surface actionable insights. Whether you prefer the straightforward Filters pane or the more powerful DAX functions like TOPN and RANKX, you have multiple ways to highlight what truly matters in your data and guide your strategy.

The learning curve for tools like Power BI, especially when diving into DAX, can feel steep at times. At our core, we believe data analysis shouldn't require you to become an expert in formula languages or complex software. That’s why we built Graphed to be your personal AI data analyst. You can just ask questions in plain English, like, "show me a bar chart of my top 10 products by revenue last month," and get a live, interactive dashboard in seconds, freeing you up to act on your insights, not spend hours building reports.

Related Articles

How to Enable Data Analysis in Excel

Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!