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.
Hello.
I have some variance measures where I want to apply conditional formatting such that:
1) If the variance is 0-5% (i.e., +/- 5%), then the icon is green
2) If the variance is 5-10% (+/- 5-10%), then the icon is yellow
3) If the variance is >10% (+/- >10%), then the icon is red.
I have never used conditional formatting with absolute values before.
Can you help please.
Thanks so much.
Solved! Go to Solution.
Hi @ayeoh ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a measure.
Arrow =
// Variables to store arrow paths
var _1 = "<path d='M10 90 L50 10 L90 90 Z' fill='green' />"
var _2 = "<path d='M10 90 L50 10 L90 90 Z' fill='yellow' />"
var _3 ="<path d='M10 90 L50 10 L90 90 Z' fill='red' />"
// Select arrow to use
var arrow = SWITCH(TRUE(),
ABS([variance])>=0 && ABS([variance])<0.05,_1,
ABS([variance])>=0.05 && ABS([variance])<0.1,_2,
ABS([variance])>=0.1,_3)
// Insert arrow into SVG
var svg ="data:image/svg+xml;utf8," &
"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'>"
& arrow &
"</svg>"
RETURN svg
(3) Setting the Conditional Format and then the result is as follows.
For more details, refer: Sharp Vector Collections - SVG Repo
Conditional Formatting Using Icons In Power BI 🔶 - Excelerator BI
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ayeoh ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a measure.
Arrow =
// Variables to store arrow paths
var _1 = "<path d='M10 90 L50 10 L90 90 Z' fill='green' />"
var _2 = "<path d='M10 90 L50 10 L90 90 Z' fill='yellow' />"
var _3 ="<path d='M10 90 L50 10 L90 90 Z' fill='red' />"
// Select arrow to use
var arrow = SWITCH(TRUE(),
ABS([variance])>=0 && ABS([variance])<0.05,_1,
ABS([variance])>=0.05 && ABS([variance])<0.1,_2,
ABS([variance])>=0.1,_3)
// Insert arrow into SVG
var svg ="data:image/svg+xml;utf8," &
"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'>"
& arrow &
"</svg>"
RETURN svg
(3) Setting the Conditional Format and then the result is as follows.
For more details, refer: Sharp Vector Collections - SVG Repo
Conditional Formatting Using Icons In Power BI 🔶 - Excelerator BI
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Read this article: https://community.fabric.microsoft.com/t5/Desktop/Changing-Number-Format/td-p/3710518#M1208645
If you need any additional help, please let me know.
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
94 | |
75 | |
63 | |
62 |
User | Count |
---|---|
143 | |
104 | |
104 | |
80 | |
66 |