Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Display an Image if not filtered

Hi Guys,

 

I'm trying to display a default image if the filter is not selecting anything. The problem is qhen there is no filter applied and comes the "first link" eg.:

TABLE

table

 

NOT FILTERED

 

FILTERED

  • Hi Anonymous

     

    I would recommend creating a measure such as this:

     

    Selected Link =
    SELECTEDVALUE ( YourTable[Link], <expression resturning default link> )

    This will return a default link in the case of multiple Link values, otherwise the selected link image in the case of a single Link value.

     

    Ensure that the Data Category for this measure is set to Image URL (Modeling => Data Category) and then place this measure in the table or other visual that supports Image URLs.

     

    Regards,

    Owen

3 Replies

  • Hi Anonymous

     

    I would recommend creating a measure such as this:

     

    Selected Link =
    SELECTEDVALUE ( YourTable[Link], <expression resturning default link> )

    This will return a default link in the case of multiple Link values, otherwise the selected link image in the case of a single Link value.

     

    Ensure that the Data Category for this measure is set to Image URL (Modeling => Data Category) and then place this measure in the table or other visual that supports Image URLs.

     

    Regards,

    Owen

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you OwenAuger

      It really solved my problem and i learned a new formula =)

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous,

     

    I'd like some sample data for test and coding formula. 

    According to your snapshot, it seems like summarize mode 'first' return the first record based on alphabetical order.

     

    Regards,

    Xiaoxin Sheng