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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
powerbiexpert22
Impactful Individual
Impactful Individual

change background color of custom image

i want to change the color of custom image based on condition , example if revenue is greater then 1000 then color of book should be red as shown below else it should be blue, currently the color is red as you can see below. please see pbix file for reference

https://drive.google.com/file/d/1T2hqqjgk4uaz3EF6yXYPepUbe0iLo6cJ/view?usp=drive_link

 

powerbiexpert22_0-1764312497650.png

 

 

 

1 ACCEPTED SOLUTION
anilelmastasi
Super User
Super User

Hello @powerbiexpert22 ,

 

You want to change the color of cover of the book right? Because of this is a custom image, you should create a new image with AI or Internet Sites and create blue version of this. After that you can upload this images to SharePoint, or Internet Websites. After that you can create measure like this:

 

ImageURL =
SWITCH(
    TRUE(),
    'table'[book] = "a",    "https://www.imgbb.com/img/a.png",
    'table'[book] = "b",   "https://www.imgbb.com/img/b.png",
    'table'[book] = "c",   "https://www.imgbb.com/img/c.png",
    BLANK()
)

 

And then, Go to table, Format, Conditional Formatting, Image Url (or Web URL). Add this measure.

 

If this solved your issue, please mark it as the accepted solution.

View solution in original post

5 REPLIES 5
xifeng_L
Super User
Super User

Hi @powerbiexpert22 

 

As @anilelmastasi  said, we can use measure to return the image that should be displayed.

 

Here I would like to add some details. In the latest version of PowerBI, images can support more features, such as using measure to return images.

 

xifeng_L_0-1764316772957.png

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

Hi @powerbiexpert22 ,

Thank you for reaching out to the Microsoft Community Forum.

 

Hi @anilelmastasi , @rohit1991  and @xifeng_L . Thank you for your prompt responses.

 

Hi @powerbiexpert22 ,  could you please try the proposed solutions shared by  @anilelmastasi  and @xifeng_L ? Let us know if you’re still facing the same issue we’ll be happy to assist you further.

 

Regards,

Dinesh

Hi @powerbiexpert22 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.

 

Regards,

Dinesh

rohit1991
Super User
Super User

Hii @powerbiexpert22 

 

Your report is now working exactly as expected  the book image changes color based on the Total Sales condition.

You can open and check the working solution using the link below:

https://netorgft12209796-my.sharepoint.com/:u:/g/personal/rohit91_oxygenbi_com/EaJgNLvUy-BDgdMlMDjrI... 

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
anilelmastasi
Super User
Super User

Hello @powerbiexpert22 ,

 

You want to change the color of cover of the book right? Because of this is a custom image, you should create a new image with AI or Internet Sites and create blue version of this. After that you can upload this images to SharePoint, or Internet Websites. After that you can create measure like this:

 

ImageURL =
SWITCH(
    TRUE(),
    'table'[book] = "a",    "https://www.imgbb.com/img/a.png",
    'table'[book] = "b",   "https://www.imgbb.com/img/b.png",
    'table'[book] = "c",   "https://www.imgbb.com/img/c.png",
    BLANK()
)

 

And then, Go to table, Format, Conditional Formatting, Image Url (or Web URL). Add this measure.

 

If this solved your issue, please mark it as the accepted solution.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.