Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

removing filter context for a switch formula

Hi all,

 

I have a sum measure and a RankX measure based on the Sum Measure. Now I want to create a measure which uses the output of the Rankx Measure to change this number in order to be able to create A podium visual with a bar chart. 

My data looks like this:

 

CategorySum of salesRankDesired measure result
A120033
B150012
C130021

 

So If the Rank = 1 then 2, IF rank =2 then 1, IF rank =3 then 3

I Tried to use the following formula but it returns only 2 probably because of the row filter context.

 SWITCH(
Rank,1,2,
 Rank,2,1,
Ranks,3,3))

 
Hope you can help me

 

  • Anonymous 

    It should work. Did you use correct syntax of SWITCH funtion?

    should be 

    SWITCH (

    TEUE ( ),

    Rank,1,2,
     Rank,2,1,
    Ranks,3,3)

2 Replies

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Anonymous 

    It should work. Did you use correct syntax of SWITCH funtion?

    should be 

    SWITCH (

    TEUE ( ),

    Rank,1,2,
     Rank,2,1,
    Ranks,3,3)