Creating a Dynamic Table for the Top 5 Selling Products per Region

0 votes

Creating a Dynamic Table for the Top 5 Selling Products per Region
A manager requests a report showing the top 5 selling products in each region. How can you create a dynamic table in Power BI that updates to show only the top 5 products per region based on user-applied filters?

16 hours ago in Power BI by Evanjalin
• 17,020 points
20 views

1 answer to this question.

0 votes

As data on what to update was not available until October 2023, to establish a dynamic table in Power BI displaying the top 5 selling products per region, use DAX measures and visual filters. The table will update itself based on whatever filters the user applies.

1. Create Measure for Total Sales

This measure gives the total sales for each given product:

Total Sales = SUM(Sales[Amount])

2. Create a Ranking Measure

To rank products within each region, use the RANKX function:

Product Rank = 
RANKX(
    FILTER(
        Sales, 
        Sales[Region] = SELECTEDVALUE(Sales[Region])  -- Ensure ranking is per region
    ),
    [Total Sales], 
    , DESC, DENSE
)

Products are ranked according to sales within each Region.

DENSE relies on assigning consecutive ranks (for example, 1, 2, 3, 3, 4).

3. Apply a Visual-Level Filter.

Add a Table or Matrix visualization with Product Name, Region, and Total Sales.

The visual filter is Applied to Product Rank by Rank ≤ 5.

The table would now simultaneously update depending on the chosen Region or any other filter.

Alternative: Create a Calculated Table for Static Reporting.

If your interest lies in getting a pre-computed table rather than a dynamic visual, then this DAX table should be used:

Top5ProductsPerRegion = 
FILTER(
    ADDCOLUMNS(
        Sales, 
        "Product Rank", 
        RANKX(
            FILTER(Sales, Sales[Region] = EARLIER(Sales[Region])),
            Sales[Total Sales], 
            , DESC, DENSE
        )
    ),
    [Product Rank] <= 5
)

This table stores the top 5 products per region permanently but won’t update dynamically with slicers.

answered 16 hours ago by anonymous
• 17,020 points

Related Questions In Power BI

+1 vote
1 answer
0 votes
0 answers

What is the best approach for creating a live connection from Power BI to PostgreSQL?

What is the best approach for creating ...READ MORE

Dec 17, 2024 in Power BI by Evanjalin
• 17,020 points
67 views
0 votes
1 answer

What is the best approach for creating a live connection from Power BI to PostgreSQL?

The most convenient way to set up ...READ MORE

answered Dec 18, 2024 in Power BI by Vani
• 3,140 points
177 views
0 votes
1 answer

DAX Calculation the Max for a Group.

You can try this out:  Desired Output=CALCULATE(MAX([Check]), ...READ MORE

answered Sep 25, 2020 in Power BI by Gitika
• 65,770 points

edited Sep 25, 2020 by Gitika 5,389 views
+2 votes
0 answers

Assume referential integrity

1) What is Assume referential integrity? what ...READ MORE

Aug 19, 2019 in Power BI by vnk
1,912 views
+2 votes
1 answer

If Condition

DAX - I assume [Claim_line].[Allowed_Amount_B6] is one ...READ MORE

answered Aug 20, 2019 in Power BI by anonymous
• 33,030 points
1,709 views
+2 votes
1 answer

How to export data to CSV from power bi embedded url ?

Hi Arathi, You can open Visuals from embedded ...READ MORE

answered Aug 23, 2019 in Power BI by anonymous
• 33,030 points
6,774 views
+1 vote
1 answer

Power Bi to Machine Learning Model

Hello @vnk! Power BI only supports Azure Machine ...READ MORE

answered Dec 3, 2019 in Power BI by Priyanka
1,285 views
0 votes
1 answer

What are the best practices for using Power BI connectors to monitor user activities and interactions within a dashboard?

Power BI dashboards. Some best practices for ...READ MORE

answered Feb 24 in Power BI by anonymous
• 17,020 points
45 views
0 votes
1 answer

What is the process for updating key credentials of a Databricks data source via the Power BI REST API?

Updating Databricks Credentials in Power BI via ...READ MORE

answered 6 days ago in Power BI by anonymous
• 17,020 points
41 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP