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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.