cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dgwilson
Resolver III
Resolver III

FORMAT icon set for use in a data card

I'm building my own KPI indicator. The last element to get working is an indicator icon.

 

I have a DAX Measure that turens 0, 1, 2 (Up, Down, Neutral). All I need out of that is the ICON.

Fundamentally this does the trick.

 
    SWITCH (
            TRUE(),
            theIndicator = 1, "ColoredArrowUp",
            theIndicator = 0, "ColoredArrowRight",
            theIndicator = 2, "ColoredArrowDown"
            )
 

Is it possible to now use the FORMAT DAX command deliver the ICON result? It doesn't have Custom Formatting available.

I can deliver the ICON via a Table - but that has a column header and row values - so that's super ugly.

 

How would you deliver the ICON?

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @dgwilson 

You could look at the UNICHAR() function to return an icon to a card.  It would be something like this where [Parameter Value] is your measure that returns the result.

Icon = 
VAR theIndicator = [Parameter Value]
RETURN
   SWITCH (
            TRUE(),
            theIndicator = 1, UNICHAR(9650),
            theIndicator = 0, UNICHAR(9654),
            theIndicator = 2, UNICHAR(9660)
            )

Then you can make a measure that does the conditional fomatting on the data label as well.

conditionalformatLabel.jpg

Icon Format = 
VAR theIndicator = [Parameter Value]
RETURN
   SWITCH (
            TRUE(),
            theIndicator = 1, "Green",
            theIndicator = 0, "Yellow",
            theIndicator = 2, "Red"
            )

When you combine the two together in a card you will be close I think.

ConditionalFormatIcon.jpg

View solution in original post

7 REPLIES 7
jdbuchanan71
Super User
Super User

It depends on which week you select.  If you pick one where the WoW change is > 0 it will be green:

jdbuchanan71_0-1650751353173.png

 

jdbuchanan71
Super User
Super User

The measure [Icon] goes on a card and the measure [Icon Format] is used in the conditonal formatting.  In a card the formatting is applied to the callout value.

I have also attached a sample file for you to look at.

2022-04-23_8-20-30.jpg

 

 

I made some change. if value > 1 then it should be green etc. please look at the file it just give me Red while it should give me Green becuse the value is > 1

check the file please

 Format icon 

jdbuchanan71
Super User
Super User

Hello @dgwilson 

You could look at the UNICHAR() function to return an icon to a card.  It would be something like this where [Parameter Value] is your measure that returns the result.

Icon = 
VAR theIndicator = [Parameter Value]
RETURN
   SWITCH (
            TRUE(),
            theIndicator = 1, UNICHAR(9650),
            theIndicator = 0, UNICHAR(9654),
            theIndicator = 2, UNICHAR(9660)
            )

Then you can make a measure that does the conditional fomatting on the data label as well.

conditionalformatLabel.jpg

Icon Format = 
VAR theIndicator = [Parameter Value]
RETURN
   SWITCH (
            TRUE(),
            theIndicator = 1, "Green",
            theIndicator = 0, "Yellow",
            theIndicator = 2, "Red"
            )

When you combine the two together in a card you will be close I think.

ConditionalFormatIcon.jpg

i did not understand the solution. can you explain where i should use the measure in a card or what? it will not let me

I've been able to get to this...  🙂

Bit more cleanup required... however it's getting there...

2019-10-08 14_08_59-Revenue Summary Test - Power BI Desktop.png

That is a very nice solution. Thank you.

I have a few more measures that I'd really like just to support the implementation, I can hopefully workaround this with groups and/or naming of the measures.

 

Thank you.

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors