Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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)
1 ACCEPTED SOLUTION
amirabedhiafi
Impactful Individual
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]

    )

 

Amira Bedhiafi
Full Stack Business Intelligence Consultant @Capgemini

View solution in original post

2 REPLIES 2
amirabedhiafi
Impactful Individual
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]

    )

 

Amira Bedhiafi
Full Stack Business Intelligence Consultant @Capgemini
Anonymous
Not applicable

@amirabedhiafi Thank you! Works like a charm 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors