Forum Discussion
Composite Key Error & Top Values
Hi SudharsanRaja ,
for the usage of the parameter values in SELECTEDVALUE format you need to use the Order Column where you have the or add a new column to your table that is a duplication of the first column that you want to use.
If you change your measure to the folllowing code it should work:
Rank__ = SWITCH(
TRUE(),
SELECTEDVALUE(Parameter[Order])=0,
RANKX(ALLSELECTED(financials[Country]),
[Sales_Measure],,DESC),
SELECTEDVALUE(Parameter[Order])=1,
RANKX(ALLSELECTED(financials[Product]),
[Sales_Measure],,DESC),
SELECTEDVALUE(Parameter[Order])=2,
RANKX(ALLSELECTED(financials[Segment]),
[Sales_Measure],,desc))
I'm assuming that the order of your parameter is Country, Product, Segment
- SudharsanRaja1 year agoNew Member
Thanks MFelix . Composite key error is resolved! Rank function is executing first and then it is filtering the profit value greater than 180. But in my case it needs to execute in reverse order! Do you have any suggestions?
- MFelix1 year agoSuper User
How are you doing the filtering for the 180? In the syntax you present there is no filter on the dax measures.
- SudharsanRaja1 year agoNew Member
In dax measure I am not creating any filtering for 180. In visual filter I am using profit greater than 180!