Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Finding top5 customers in each country based on sales, orders, index etc.

Hi Community!

 

I got help from a member yesterday with solving a problem where I have to calculate/visualise top5 customers from each country. It worked well (added the solution below). However if I want to add more columns to the matrix, ex. sales last year, number of orders, number of orders last year, index etc. I get a lot more visulized than just the top 5 customers from each country.

 

Is there a solution to this? Either by adding som extra code to the one below or do I need another measure for each column? I am not sure it is the best solution to add a measure on each column.

 

Looking forward to your answers.

 

BR

 

 

You will need a measure that just calculates the sales amount.

Sales Amount = SUM ( Sales[Amount] )

Then you can use another measure to calculate your top 5 customers by country.

Top 5 Customer Sales = 
VAR RankingContext = VALUES ( Customer[Name] )
RETURN
CALCULATE(
    [Sales Amount],
    TOPN ( 5, ALL ( Customer[Name] ), [Sales Amount] ),
    RankingContext
)

Top5Customers.jpg

2 REPLIES 2
RobbeVL
Impactful Individual
Impactful Individual

You will have to do the same thing for every value.

Or you could create a calculated table with all the values you want and just create a tableviz.

 

Robbe

Anonymous
Not applicable

It will not be possible to add some kind of DAX filter code around it that will make it work at all columns at one in the matrix? 🙂

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors