cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

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
Highlighted
Super User IV
Super User IV

Re: Indicator Icon on result of measure

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-...

 


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Helper IV
Helper IV

Re: Indicator Icon on result of measure

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
June 2020 Community Highlights

June 2020 Community Highlights

Featured community members, changes to the Community, and more! Read up on recent Power BI community news.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors