Forum Discussion
Anonymous
4 years agoNot applicable
Rankx for a Hierarchy
Hi All, I am having trouble getting my matrix to sort based on a selected value from the slicer. For example, if the selected value is "Base Salary" then I would like the base salary column to be...
amitchandak
Super User
4 years agoAnonymous , You can create two ranks measure or vars
Rank1 = RANKX(ALL(Table[Job Title]), [salary])
Rank2 = RANKX(ALL(Table[Name]), [salary])
Switch rank = Switch( True() ,
isinscope(Table[Name]) , [Rank2],
isinscope(Table[Job Title]) , [Rank1],
blank()
)
Anonymous
4 years agoNot applicable
Hi amitchandak! Thanks for your quick response,
I tried this just now, It is not working when I have the [Name] field as the second level to the heiarchy. Am I missing something?
- amitchandak4 years ago
Super User
Anonymous ,
Switch rank = Switch( True() ,
isinscope(Table[Name]) , [Rank2],
isinscope(Table[Job Title]) && not(isinscope(Table[Name]) ) , [Rank1],
blank()
)
- Anonymous4 years agoNot applicable
Unfortunately, this is not working either...