Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measure shows incorrect image

Hello everyone,
 
I have created a measure which I plotted in the visual Image by Cloudscope. My intention is to show the player when one player is selected, but show the image 'Several players_svg' when two or more players are filtered. Unfortunately, it only returns that image, even though I only select one player. I am not following the logic; why isn't it working and what has to be changed?
 
The measure is as follows:
 
Players_svg =
VAR Player =
SWITCH(
TRUE(),
VALUES('Players'[PlayerID]) = 1,
[Messi_svg],
VALUES('Players'[PlayerID]) = 2,
[Lewandowski_svg],
VALUES('Players'[PlayerID]) = 3,
[Ronaldo_svg],
VALUES('Players'[PlayerID]) = 4,
[Haaland_svg],
VALUES('Players'[PlayerID]) = 5,
[Van Dijk_svg]
)
RETURN
IF(NOT(ISFILTERED(Players[PlayerID])), [Several players_svg],
Player)
  • Try the following :

    YourSelection =

    VAR Selection =

        SELECTEDVALUE ( 'Players'[PlayerID] )

    RETURN

        SWITCH (

            TRUE (),

            Selection = 1,[Messi_svg],

            Selection = 2,[Lewandowski_svg],

            Selection = 3,[Ronaldo_svg],

            Selection = 4,[Haaland_svg],

            Selection = 5,[Van Dijk_svg],

           [Several players_svg]

        )

     

2 Replies

  • amirabedhiafi's avatar
    amirabedhiafi
    Impactful Individual

    Try the following :

    YourSelection =

    VAR Selection =

        SELECTEDVALUE ( 'Players'[PlayerID] )

    RETURN

        SWITCH (

            TRUE (),

            Selection = 1,[Messi_svg],

            Selection = 2,[Lewandowski_svg],

            Selection = 3,[Ronaldo_svg],

            Selection = 4,[Haaland_svg],

            Selection = 5,[Van Dijk_svg],

           [Several players_svg]

        )