Forum Discussion
Dynamic images based on selections
- 3 months ago
Hi Th1sGuy
I'm sure there must be plenty of different ways to achieve this, but the first thing that comes to my mind is using the new image SVG option (https://www.youtube.com/watch?v=BvKbKQHVNi0&t=125s).
However, you will need to convert or generate your images in SVG format.
Once you have the SVG image code, it's pretty easy , just create measures (you can use any AI tool to convert your SVG image code into a measure), like in the attached sample, and use a slicer to switch between the images.
I have attached the sample I created for your reference.
The cleanest way is to drive this from a column, since "Image URL" is a column level data category in Power BI.
Add a small lookup table in Power Query with two columns, status and icon URL, and relate it to your existing program/status field. Select the URL column, go to Column tools and set Data category to Image URL. Drop the column into a Card visual (or table/matrix), and the slicer will swap the icon automatically as the selection changes.
If you prefer SWITCH in a measure, that works too, but you have to render it through the newer Image visual, since measures cannot carry the Image URL category.
If this works for you, kindly mark it as the solution and give a thumbs up.
Best,
Shai Karmani