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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
sowmyar
Frequent Visitor

Ranking in MAtrix

I created rank measure and applied to the matrix with 4 categories the  ranking is fine for the first level(customer) and the ranking changes whe i expand the matrix .But in my scenario i just need rank for customer and the same rank should be there for all the other categories,becoz i will filter the top 10  and top 20 rank

 

the rankis fine for the first level without expanding

sowmyar_1-1673865565819.png

its skipping rank 10-dont know why

 

sowmyar_2-1673865705438.png

 

Rank = CALCULATE(RANKX(ALLselected('Fact'[Customer]),CALCULATE(SUM('Fact'[Factored_Turnover_Customer]),ALLEXCEPT('Fact','Fact'[Customer],'Fact'[Year],'Fact'[Tender Type],'Fact'[Lead/Tender Schedule])),,DESC,Dense),ALLSELECTED('Fact'[Year],'Fact'[Sales_Stage],'Fact'[Project])) this is y rank measure and after  which i need to show top 10,20,...50 baased on customer selection
 
Thanks in advance
2 REPLIES 2
sowmyar
Frequent Visitor

I worked fine for first level only with customer

sowmyar_0-1673894165631.png

when i added another row (year field) it showed me additional 2 data

sowmyar_1-1673894425367.pngshould we add the year fields to the columns only?

TopN customer =
VAR SelectedTop = SELECTEDVALUE('rankingrange'[rankingrange])
RETURN
SWITCH(TRUE(),
SelectedTop = 0, [Sales(Customer)],
RANKX (
ALLSELECTED( 'Fact'[Customer]),
[Sales(Customer)]
)
<= SelectedTop,
[Sales(Customer)]
)
 
Sales(Customer) =
CALCULATE(SUM('Fact'[Factored_Turnover_Customer]))
amitchandak
Super User
Super User

@sowmyar , You can TOPN with Numeric Parameters

 

Watch TOPN with Numeric Parameter -https://youtu.be/cN8AO3_vmlY?t=26448

 

https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.