Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Default Image via Slicer

Issue : Displaying an image when "All" is selected in slicer

 

Current Implementation : I have a Slicer (Country) that has linked the Image visual to it among other visuals. The image contains URLs of a Flag Image for each country. The Image visual currently works great whenever the slicer is on a single value. However, it would be nice if there was a way to have the the Image default to a different picture whenever there was more than one country selected in my Slicer.

 

I currently don't see a way to do this but thought I'd post to the community in case someone has figured out a way.

  • Hi Anonymous ,

     

    You should store the default image URL into dataset.

     

    New a calculated table which is unrelated to above image table, to list all available slicer items.

    slicer = VALUES(Table6[Column1])

     

    Add below measure into Image visual "visual level filters", set its value to 1.

    Check measure =
    IF (
        COUNT ( slicer[Column1] ) <= 1
            && SELECTEDVALUE ( Table6[Column1] ) = SELECTEDVALUE ( slicer[Column1] ),
        1,
        IF ( SELECTEDVALUE ( Table6[Column1] ) = "Default Image", 1, 0 )
    )

     

    Best regards,

    Yuliana Gu

2 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi Anonymous ,

     

    You should store the default image URL into dataset.

     

    New a calculated table which is unrelated to above image table, to list all available slicer items.

    slicer = VALUES(Table6[Column1])

     

    Add below measure into Image visual "visual level filters", set its value to 1.

    Check measure =
    IF (
        COUNT ( slicer[Column1] ) <= 1
            && SELECTEDVALUE ( Table6[Column1] ) = SELECTEDVALUE ( slicer[Column1] ),
        1,
        IF ( SELECTEDVALUE ( Table6[Column1] ) = "Default Image", 1, 0 )
    )

     

    Best regards,

    Yuliana Gu

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Yuliana Gu,

       

      Thank you very much for the quick response. Makes sense and I'll incorporate it this afternoon.