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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
tuncay
Helper III
Helper III

Add colored KPI arrows to show the trend

I have created a measure, which calculates different values and the result is a difference percentage (e. g. 2%).

Now, I want to create a textbox or card, where I have an arrow, which should change its color and direction based on the result.

 

if the amount is bigger than 5% it should show up and should be green.

if the amount is between 0 and 5% it should be yellow

if the amount is less thabn 0 it should be red and show down.

 

I tried this, but it doesn't work so well and the colors don't change.

 

Spoiler
OEE comparison = if('YTD'[Productivity check] > 0, "↑",
IF('YTD'[Productivity check] > 1, "→",
IF ('YTD'[Productivity check] < 0, "↓")))

 

 

I hope somebody can help.

1 ACCEPTED SOLUTION
v-yetao1-msft
Community Support
Community Support

Hi @tuncay 

Is this the result you want ?If yes , you can refer to the following steps .

Ailsamsft_0-1631610779024.png

I searched the arrow in Unicode , but the blue and green arrows do not have a corresponding Unicode , so we need to make appropriate changes .

(1) Find the Unicode of all arrows that meet the direction requirements. Then create a calculated column to judge the diff and color and direction .The color for the arrows are all black .

Column = SWITCH (TRUE(),[diff] > 0.05, UNICHAR(9650),[diff] >= 0 && [diff]<=0.05, UNICHAR(9654),[diff] < 0, UNICHAR(9660))

(2)Configure conditional formatting for the Column to change the Font color .

Ailsamsft_1-1631610779026.png

Select Rules in Format by , diff in Based on Field ,then according to different interval values, choose the corresponding color ,like the screenshot below .

Ailsamsft_2-1631610779029.png

I have attached my pbix file , you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-yetao1-msft
Community Support
Community Support

Hi @tuncay 

Can the solution I provide meet your needs ? If yes , please consider Accept it as the solution to help the other members find it more quickly .

 

Best Regards

Community Support Team _ Ailsa Tao

v-yetao1-msft
Community Support
Community Support

Hi @tuncay 

Is this the result you want ?If yes , you can refer to the following steps .

Ailsamsft_0-1631610779024.png

I searched the arrow in Unicode , but the blue and green arrows do not have a corresponding Unicode , so we need to make appropriate changes .

(1) Find the Unicode of all arrows that meet the direction requirements. Then create a calculated column to judge the diff and color and direction .The color for the arrows are all black .

Column = SWITCH (TRUE(),[diff] > 0.05, UNICHAR(9650),[diff] >= 0 && [diff]<=0.05, UNICHAR(9654),[diff] < 0, UNICHAR(9660))

(2)Configure conditional formatting for the Column to change the Font color .

Ailsamsft_1-1631610779026.png

Select Rules in Format by , diff in Based on Field ,then according to different interval values, choose the corresponding color ,like the screenshot below .

Ailsamsft_2-1631610779029.png

I have attached my pbix file , you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Please assist how to change color in updated power bi desktop version as of now we dont have option of Roller now we just have visuals and properties.

sailochanar_0-1680686623080.png

How to change color of upper arrow ?

 

Thanks.

amitchandak
Super User
Super User

@tuncay , You need to create an arrow and color and then use conditional formatting with field value option to color the arrow

 

example

 

/////Arrow
Arrow =
var _change =[Net Sales YTD]-[Net Sales LYTD]
return
SWITCH (
TRUE(),
_change > 0, UNICHAR(9650),
_change = 0, UNICHAR(9654),
_change < 0, UNICHAR(9660)
)


/////Arrow Color
Arrow color =
var _change =[Net Sales YTD]-[Net Sales LYTD]
return
SWITCH (
TRUE(),
_change > 0, "green",
_change = 0, "blue",
_change < 0, "red"
)

 

 

refer if needed

 

https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/
https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692

https://exceleratorbi.com.au/dax-unichar-function-power-bi/

Yeah ,I did as u said but then it is projecting as Green instead of color to upper arrow. 

like this ..

sailochanar_1-1680687246794.png

how to solve..?

Thank you for your reply.

Is it possible for the arrow color to have the blue color not for 0, but for between 0 and 1?

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.