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
mahirk81
Employee
Employee

show/hide an Image based on Slicer selection

Hi All,

 

Can we show/hide an Image based on Slicer selection in PowerBI?
Example : I will update the Image in PowerBI and when I select the slicer as Yes, then the Image should show and If it is No, then Images should hide.
 
Is it possilble?
 
Thanks,
Mahi
1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @mahirk81 


You may create a table like below.

New:

f1.png

 

Then you may modify the measure as below.

Visual control = 
IF(
    SELECTEDVALUE(New[IsDisplay])="Yes",
    1,
    IF(
        SELECTEDVALUE(New[IsDisplay])="No",
        0
    )
)

 

Result:

f2.png

f3.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @mahirk81 


You may create a table like below.

New:

f1.png

 

Then you may modify the measure as below.

Visual control = 
IF(
    SELECTEDVALUE(New[IsDisplay])="Yes",
    1,
    IF(
        SELECTEDVALUE(New[IsDisplay])="No",
        0
    )
)

 

Result:

f2.png

f3.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-alq-msft
Community Support
Community Support

Hi, @mahirk81 

 

Based on your description, I created data to reproduce your scenario.

Table:

d1.png

Test(a calculated table):

Test = DISTINCT('Table'[ID])

 

You need to set data category for 'Image url' as Image URL.

d2.png

 

Then you may create a measure as beolw.

Visual control = 
IF(
    ISFILTERED('Test'[ID]),
    IF(
        SELECTEDVALUE('Table'[ID]) in FILTERS('Test'[ID]),
        1,0
    ),
    0
)

 

Finally you may put the measure in the visual level filter and use the 'ID' column from 'Test' to filter the result.

d3.png

d4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

amitchandak
Super User
Super User

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