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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Kamaizziati
Helper IV
Helper IV

Display Image based on value

Hi All,

 

I have data percentage that need to display using card custom visual. Then I want to show the picture changes according to the data percentage.

 

Example : If value percentage is positive then the thumb-up picture will display, then if percentage is negative the thumb picture will change to thumb-down.

 

There is any suggestion custom visual to use or DAX cosding to be apply?

 

2018-02-08_1155.png

 

Thanks

1 ACCEPTED SOLUTION
Phil_Seamark
Employee
Employee

Hi @Kamaizziati

 

Here is a quick and easy way to do it.  Drop this calculated measure in and replace the hardcoded values for myVal & myTarget with your own values.

 

Measure = 
VAR myVal = 4
VAR myTarget = 0
RETURN IF(
            myVal <= myTarget ,
            -- THEN --
             UNICHAR(128402) , -- Thumbs up! 
             -- ELSE --
               UNICHAR(128403) -- Thumbs down
            )
             

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

7 REPLIES 7
Jnkrick
Frequent Visitor

I LOVE THIS and am hoping I can get it to work for my needs (if thumbs up was green and down was red that'd be even better but if not this meets the needs)

 

So I think the thumb is meeting extra complication because for the visualization of the 95% on the left and the 93% on the right, the only difference between these two donuts is I've used a filter to filter for only the % favorable for that specific question.

 

Jnkrick_0-1652204267422.png

For gained an maintained the target is 88% or above so the thumbs up is right, but when I changed myTarget to 95, then gained and maintained would not be hitting the mark and should be thumbs down. 

 

So either, can you help me build this formula to also filter for specific question or do I have to make calcualted measures for each question % favorable??

 

Thank you!!

 

Phil_Seamark
Employee
Employee

Hi @Kamaizziati

 

Here is a quick and easy way to do it.  Drop this calculated measure in and replace the hardcoded values for myVal & myTarget with your own values.

 

Measure = 
VAR myVal = 4
VAR myTarget = 0
RETURN IF(
            myVal <= myTarget ,
            -- THEN --
             UNICHAR(128402) , -- Thumbs up! 
             -- ELSE --
               UNICHAR(128403) -- Thumbs down
            )
             

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi @Phil_Seamark,

 

Can I chnage the UNICAR code to image URL?

Where should I find the UNICHAR code for other code or picture?

 

Thanks

por aquí tienes un montón:

https://www.vertex42.com/ExcelTips/unicode-symbols.html

 

saludos.

Hi @Phil_Seamark,

 

What is myVal and my Traget? it is for my percentage value?

Can I send to you my power Bi file 

myVal should be the number you are using in your percentage.  MyTarget can be 0

 

Yes, please send me your PBIX file (or a link to a Onedrive with it)

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi @Phil_Seamark,

 

The statement work for me.

 

Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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