Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Wanted a round shaped image in table visual

Hi All, I have one question related to Power BI. I'd like to inquire about a method to add an image to a table visual sourced from either an Excel file or a SharePoint site. I need this image to dynamically change based on filter selections. However, the crucial requirement is that the image should appear in a round shape rather than the default square shape. Currently, when I add the image using its URL, it displays in a square shape. Any guidance on achieving a round-shaped image in the table visual would be greatly appreciated. Thank you!

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    After testing, you cannot change the shape of the image in table visual, but you can use the custom visual: html content , it can use html to custom the image.

    you can refer to the following link.

    Use HTML to make Power BI images/icons more interesting (vahiddm.com)

    and you can create a measure, then put the measure into the 'html content' visual, you can refer to the following code.

     

    Black and white = 
    Var _Image1 = "https://powerapps.microsoft.com/images/application-logos/svg/powerbi.svg"
    Return
    "<style>
    img {
      transition: filter .5s ease-in-out;
      filter: grayscale(0%); 
      border-radius: 50%;
    }
    img:hover {
      filter: grayscale(100%);
    
      blur(5px);
    }
    </style>
    <img src='" & _Image1 & "' >"
    

     

    Output

    Best Regards!

    Yolo Zhu

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

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous v-xinruzhu-msft, thank you for providing the solution. However, I'm uncertain if it will meet my needs. Specifically, I require a round-shaped image within a column of a table visual, aligned with another column, and it should respond correctly to any applied filters. Since this solution seems to be implemented in a separate custom visual, I'm unsure if it will fully fulfill my requirements.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous 

      The table visual cannot support change the image shape.

       

      Best Regards!

      Yolo Zhu