Forum Discussion
SudharsanRaja
1 year agoNew Member
Composite Key Error & Top Values
USECASE: I created parameter for product, country and segment. * When I clicked the product, it has to display profit greater than 180. And top 2 sales in descending order. * When I clicked the Co...
MFelix
1 year agoSuper User
Hi SudharsanRaja ,
The question is the context of the measure and the filter context that you are using since the measure is done on top of allselected only after doing that the values will be filter by the 180 doing the incorrect calculation you need to have the filter context of the values on the measure also.
Try to change your calculation to something similar to this:
RANKX(
FILTER( ADDCOLUMNS(ALLSELECTED(financials[Country]), "TotalSales",[Sales_Measure]), [TotalSales] > 180)
,
[TotalSales],,DESC)