Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
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
)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
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? 🙂
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!