Forum Discussion

Chrisjr's avatar
Chrisjr
Helper IV
2 years ago

Top/Bottom filter not working properly

Hello All, 

 

I have the following visual :

 

 

When I selecet the top 3, the Ranking var mesrure in the last column gives me the result of the top 3. same for the bottom 3.

 

The problem is when I select a district in the filter "N distric"(each Dealer/Group Name belong to a District number)  , it gives me the top 3 but no values for  the bottom 3 . See below:

 

 

 

My data model :

 

 

The dax for the Ranking var is : 

Ranking var =
VAR _TopDealer = RANKX(ALL(Dim_dealers[Dealer/Group Name]), [Measure], , DESC)
VAR _BottomDealer = RANKX(ALL(Dim_dealers[Dealer/Group Name]), [Measure], , ASC)
VAR _ranking = IF(SELECTEDVALUE(TopBottom[Value] )= "Top", _TopDealer, _BottomDealer)
RETURN
IF(_ranking <= 'Ranking Option'[Ranking Option Value], [Measure])

 

 

The Ranking Option filter at the top is a paramter : 

        Ranking Option Value = SELECTEDVALUE('Ranking Option'[Ranking Option])

The Value filter is a table which I buid as : 

     TopBottom = {"Top", "Bottom"}
 
 
 
 
So, what could be wrong in my dax for not retuning values for bottom selection?
Thanks

 

2 Replies