Hi,
I’ve a problem with this measure.
Ranking =
VAR _TopBrand = RANKX(ALL(DB_MONTHLY[BRAND]),[Sales],DESC)
VAR _BottomBrand = RANKX(ALL(DB_MONTHLY[BRAND]),[Sales],ASC)
VAR _TopModel = RANKX(ALL(DB_MONTHLY[ADJ_Model]),[Sales],DESC)
VAR _BottomModel = RANKX(ALL(DB_MONTHLY[ADJ_Model]),[Sales],ASC)
VAR _TopSegment = RANKX(ALL(SEGMENTS[Total_Segments]),[Sales],DESC)
VAR _BottomSegment = RANKX(ALL(SEGMENTS[Total_Segments]),[Sales],ASC)
VAR _RANK = IF(
CONTAINSSTRING(SELECTEDVALUE(Sort_Field[Sort_Field Fields]), “Brand”)
,IF(SELECTEDVALUE(TOP_BOT[Value])= “Top” ,_TopBrand,_BottomBrand),
IF(CONTAINSSTRING(SELECTEDVALUE(Sort_Field[Sort_Field Fields]), “Model”)
,IF(SELECTEDVALUE(TOP_BOT[Value])= “Top” ,_TopModel,_BottomModel)
,IF(SELECTEDVALUE(TOP_BOT[Value])= “Top” ,_TopSegment,_BottomSegment)
)
)
RETURN
IF(_RANK<=RankN[RankN Value],[Sales])
Top/Bottom filters work well if I don’t use any FY/Month slicer, but if I want to see the bottom sales of a certain month/FY it doesn’t work anymore (it is strange that with Top option it still work)
Do you have any suggestion how to fix this problem?



