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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Rosario
Helper I
Helper I

Thumbs Up & Down Conditional

Hi, can someone please help me? I want to add a green thumb Up, or red thumb Down according to the result in the column “Diff Count 2 vs Count 1, based on the column “Items” value. I have inserted thumbs as an example how I want to achieve the result.  Many thanks. Rosario.

Rosario_0-1671417346066.png

 

 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Rosario ,

 

Here I suggest you to try to add svg in icon conditonal formatting in Power BI.

Sample Code:

 

Arrow = 
// Variables to store arrow paths
var uparrow = "<path d='M10 90 L50 10 L90 90 Z' fill='green' />"
var downarrow = "<path d='M10 10 L50 90 L90 10 Z' fill='red' />"

// Select arrow to use
var arrow = IF([Diff Count 2 vs Count 1]>=0,uparrow,downarrow)

// Insert arrow into SVG
var svg ="data&colon;image/svg+xml;utf8," &
         "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'>"
            & arrow & 
         "</svg>"

RETURN svg

 

RicoZhou_0-1671524157848.png

Save the picture of Thumbs Up & Down from Power Point to your PC and then open them in Visual studio to get the path. We just need to change the path in above code from Arrow Up & Down to Thumbs Up & Down.

RicoZhou_0-1671524533199.png

You can refer to this video ( Using SVG in Power BI ) to learn more details. The author will show you a sample with a Squirrel icon. You should watch it from 21:00.

 

Best Regards,
Rico Zhou

 

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

4 REPLIES 4
Rosario
Helper I
Helper I

Hi, can someone please help me? I want to add a green thumb Up, or red thumb Down according to the result in the column “Diff Count 2 vs Count 1, based on the column “Items” value. I have inserted thumbs as an example how I want to achieve the result.  Many thanks. Rosario.

 

Hi, thanks to who tried help me, however it hasn't been resolved yet as I want, I need the conditional result as indicated in the red circle below:

Rosario_1-1672808556268.png

 

 

Rosario
Helper I
Helper I

Hi, thanks to who tried help me, however it hasn't been resolved yet as I want, I need the conditional result as indicated in the red circle below: 

Rosario_0-1672808006407.png

Thank U.

v-rzhou-msft
Community Support
Community Support

Hi @Rosario ,

 

Here I suggest you to try to add svg in icon conditonal formatting in Power BI.

Sample Code:

 

Arrow = 
// Variables to store arrow paths
var uparrow = "<path d='M10 90 L50 10 L90 90 Z' fill='green' />"
var downarrow = "<path d='M10 10 L50 90 L90 10 Z' fill='red' />"

// Select arrow to use
var arrow = IF([Diff Count 2 vs Count 1]>=0,uparrow,downarrow)

// Insert arrow into SVG
var svg ="data&colon;image/svg+xml;utf8," &
         "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'>"
            & arrow & 
         "</svg>"

RETURN svg

 

RicoZhou_0-1671524157848.png

Save the picture of Thumbs Up & Down from Power Point to your PC and then open them in Visual studio to get the path. We just need to change the path in above code from Arrow Up & Down to Thumbs Up & Down.

RicoZhou_0-1671524533199.png

You can refer to this video ( Using SVG in Power BI ) to learn more details. The author will show you a sample with a Squirrel icon. You should watch it from 21:00.

 

Best Regards,
Rico Zhou

 

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

 

 

vicky_
Super User
Super User

You can use conditional formatting under Format Visual > Cell Elements > Icons. Unfortunately, the default set of icons does not come with the thumbs up / down, but if you absolutely need to, you can add your own custom images. Here's a tutorial on conditional formatting: https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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