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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
stuart_honeyman
Frequent Visitor

IF Function and Measure

I am trying to embed an image in a table to show some KPI's based on whether sales are up or down.

 

In order to do this I have formula as a measure to calculate the change in values to prior reporting week by client

 

% variance -1 v -2 = 
DIVIDE(SUM('Bookings'[-1 week rev])-sum(Bookings[-2 week rev]), SUM('Bookings'[-2 week rev]))

 

I am then using an if statment to return the correct image;

Column = IF([% variance -1 v -2]<0,"http://icons.iconarchive.com/icons/visualpharm/must-have/16/Stock-Index-Down-icon.png","http://icons.iconarchive.com/icons/semlabs/web-blog/32/arrow-up-icon.png")

Which in a way works...but sadly it returns both the positive and negative of the IF statement so for each client I have different results and the differing images showing. Without the IF statement, the formula works perfectly. Can anyone please shed any light on what I appear to be doing wrong?

 

TIA 

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @stuart_honeyman,

 

Can you share a sample and some snapshots?

I would suggest using Unichar arrows instead, which is simpler. Please refer to Power-BI-Desktop-DAX-Using-Unicode-Arrows-as-Measures-in-a-Table.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Floriankx
Solution Sage
Solution Sage

Can you give as a sample table to show your expected result?

 

Maybe replace the icon URLs with 'TRUE' and 'FALSE'.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors