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
MarkSL
Helper V
Helper V

Indicator Icon on result of measure

Hi, 

 

I am sure this has must have been addressed before, so I apologise in advance for failing to find the answer!

 

I want to add a green and red indicator icon to my Table visual, based on the result of a measure which returns a variance percentage of Sales vs Budget.  I currently have the following measure to work out my variance on budget:

 

Variance On Budget =
VAR __BASELINE_VALUE =
    SUM ( 'SalesFact'[Budget] )
VAR __VALUE_TO_COMPARE =
    SUM ( 'SalesFact'[Sales] )
RETURN
    DIVIDE ( __VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE )

I have then created 2nd measure to output the icon based on the result of the above:

 

Budget Indicator =
IF (
    [Variance On Budget] > 0,
    "http://server/green.png",
    "http://server/red.png"
)

When I add the above measure to my table, I can see that it is correctly assigning green or red, however it is outputting the URL string.  I therefore went to the Modelling ribbon to change the Data Category to "Image URL", however the Data Category drop down is greyed out:

 

pbi240418.png

 

 

Any help greatly appreciated!

 

Thanks

 

Mark

 

2 REPLIES 2
Greg_Deckler
Super User
Super User

Hmm, I'll have to test if calculated columns can be data categorized. In the mean time, you might try the technique here:

 

https://community.powerbi.com/t5/Community-Blog/Power-BI-Desktop-Custom-Aggregations-Formatting-and-...

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks for the link Greg.  I had been looking at Unichar characters, but all the ones that you would normally wish for, eg a simple circle or arrows only seem to be in black.  However I can use the icons in that post as a last resort.

 

Back to getting the images to work, I am new to Dax but was wondering if I could keep my two URLs in a unrelated table (ImageTable) with say 1 row and two columns ('Green' and 'Red'), with both marked as Image URL.  So some pseudo code something like:

 

 

Budget Indicator =
IF (
    [Variance On Budget] > 0,
    FIRST(ImageTable[Green]),
    FIRST(ImageTable[Red])
)

Thoughts appreciated!

 

Mark

 

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.