Forum Discussion
sowmyar
3 years agoFrequent 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
its skipping rank 10-dont know why
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
- amitchandakSuper User
sowmyar , You can TOPN with Numeric Parameters
Watch TOPN with Numeric Parameter -https://youtu.be/cN8AO3_vmlY?t=26448
- sowmyarFrequent Visitor
I worked fine for first level only with customer
when i added another row (year field) it showed me additional 2 data
should we add the year fields to the columns only?
TopN customer =VAR SelectedTop = SELECTEDVALUE('rankingrange'[rankingrange])RETURNSWITCH(TRUE(),SelectedTop = 0, [Sales(Customer)],RANKX (ALLSELECTED( 'Fact'[Customer]),[Sales(Customer)])<= SelectedTop,[Sales(Customer)])Sales(Customer) =CALCULATE(SUM('Fact'[Factored_Turnover_Customer]))