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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Icon Conditional Formating using DAX to find Value

Hello Community, 

 

I am trying to add the icon to my column SP data feed matrix [OVERALL_RATING] which have 4 value

Acceptable, Marginal, VALUE MISSING, Not Acceptable. 
The ending result, I would like to assign which of them with according color 
Circle green, Triangle Yello, Star Grey, Circle Yellow. 
Here is the sample of the data in Power BI. and the ending result that i wanted 
image.png
image.png
 
Here is my attempted DAX code 
 
Icon Set Measure =
SWITCH(
TRUE(),
'SP data feed matrix'[OVERALL_RATING] = Acceptable, "circle cx=’50’ cy=’50’ r=’40’ stroke=’green’ stroke-width=’4′ fill=’green’ /",
'SP data feed matrix'[OVERALL_RATING] = Marginal, "circle cx=’50’ cy=’50’ r=’40’ stroke=’yellow’ stroke-width=’4′ fill=’yellow’ /",
'SP data feed matrix'[OVERALL_RATING] = "VALUE MISSING", "circle cx=’50’ cy=’50’ r=’40’ stroke=’red’ stroke-width=’4′ fill=’red’ /",
'SP data feed matrix'[OVERALL_RATING] = "Not Acceptable", "circle cx=’50’ cy=’50’ r=’40’ stroke=’purple’ stroke-width=’4′ fill=’purple’ /",
"circle cx=’50’ cy=’50’ r=’40’ stroke=’white’ stroke-width=’4′ fill=’white’ /"
)
1 ACCEPTED SOLUTION

Hi @Anonymous 

 

I noticed that you didn't add the "" to include the text Acceptable,Marginal...in the dax expression. 

Here's icon formatting post probably could be your reference:

https://community.powerbi.com/t5/Desktop/Icons-Color-formatting/m-p/747856 

https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/ 

If the problem still exists, Would you mind kindly share your dummy pbix? please make sure you've removed the confidential info before.I'd like to check it further.

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

In the format option of matrix visual, you have an option for icons under conditional formatting. Choose that and check advance option, if that can help.

Or refer

https://community.powerbi.com/t5/Desktop/Icons-Color-formatting/td-p/747856

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak Thank you so much for your reply however I am trying to do conditional formatting using a text instead of whole number, I tried to copy exact the code and only change the color format but it will give me trouble. 

 

Here is my updated DAX it have the error code "The syntax for 'data' is incorrect"

 

OVERALL_RATING icon =
SWITCH (
TRUE (),
'SP data feed matrix'[OVERALL_RATING] = Acceptable , "data&colon;image/svg+xml;utf8, <svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='100' height='100' viewBox='0 0 100 100'> <circle cx='50' cy='50' r='40' stroke='purple' stroke-width='4' fill='purple' /> </svg>",
'SP data feed matrix'[OVERALL_RATING]= Marginal, "data&colon;image/svg+xml;utf8, <svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='100' height='100' viewBox='0 0 100 100'> <circle cx='50' cy='50' r='40' stroke='green' stroke-width='4' fill='dark green' />
'SP data feed matrix'[OVERALL_RATING]= "VALUE MISSING", "data&colon;image/svg+xml;utf8, <svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='100' height='100' viewBox='0 0 100 100'> <circle cx='50' cy='50' r='40' stroke='green' stroke-width='4' fill='dark green' />
'SP data feed matrix'[OVERALL_RATING]= "Not Acceptable", "data&colon;image/svg+xml;utf8, <svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='100' height='100' viewBox='0 0 100 100'> <circle cx='50' cy='50' r='40' stroke='green' stroke-width='4' fill='dark green' />
</svg>",
)

Hi @Anonymous 

 

I noticed that you didn't add the "" to include the text Acceptable,Marginal...in the dax expression. 

Here's icon formatting post probably could be your reference:

https://community.powerbi.com/t5/Desktop/Icons-Color-formatting/m-p/747856 

https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/ 

If the problem still exists, Would you mind kindly share your dummy pbix? please make sure you've removed the confidential info before.I'd like to check it further.

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.