Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Th1sGuy
Frequent Visitor

Dynamic images based on selections

Hi all,

I know there's a few questions related to this swimming around, but haven't come across my specific issue yet somewhat surprisingly.

I need to show different, color-coded images depending on programs that are selected. I initially achieved this by using a transparent version of the base image and applying conditional shading, but I'm not happy with the results. Plus, our comms dept went through the trouble of making separate icons for each status, so I'd like to use them. Here's what I created based on shading:

Th1sGuy_0-1778078512672.png


However, we have separate green, orange, and blue versions of each icon I'd like to use instead for a cleaner look. All icons are publicly accessible via URL. I'm assuming I'll need to use some sort of dax measure (leaning towards Switch), but haven't quite figured it out yet. If you need any further information, please let me know!

Any guidance would be greatly appreciated.

Thank you!

5 REPLIES 5
v-kpoloju-msft
Community Support
Community Support

Hi @Th1sGuy

Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to @kushanNa@krishnakanth240@Shai_Karmani,  for those inputs on this thread.

Has your issue been resolved? If the response provided by the community member @kushanNa@krishnakanth240@Shai_Karmani, addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.

Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.

Thank you for using the Microsoft Community Forum.

kushanNa
Super User
Super User

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.

 

Recording 2026-05-10 101836.gif

 

krishnakanth240
Resident Rockstar
Resident Rockstar

Hi @Th1sGuy

Approach is to handle this to return image URLs dynamically through measure

Can you try this approach

Dynamic Icon =

VAR Program = SELECTEDVALUE('Table'[Program])

VAR Status = SELECTEDVALUE('Table'[Status])

RETURN

SWITCH(TRUE(),

Program = "Wind" && Status = "Green", "https://.../wind_green.png",

    Program = "Wind" && Status = "Orange", "https://.../wind_orange.png",

    Program = "Wind" && Status = "Blue", "https://.../wind_blue.png",

    Program = "Solar" && Status = "Green", "https://.../solar_green.png",

    Program = "Solar" && Status = "Orange", "https://.../solar_orange.png",

    Program = "Solar" && Status = "Blue", "https://.../solar_blue.png", BLANK())

Tried getting this to work, but I'm guessing I'm doing something wrong. Would it be helpful to share the PBIX?

Shai_Karmani
Responsive Resident
Responsive Resident

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.