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 am using some "Cards" in the dashboard. These cards are showing some percentages. Now I want to change the colors based on a range of percentage.
Such as;
1. If it is <15% color will be RED.
2. If it is 15%-20% color will be ORANGE.
3. If it is >20% color will be GREEN.
I am trying to customize it from "Format" (Under visualization)>Color(under data level). I trying with "Color Scale" and "Rule" options, but not working.
Can anyone guide me please.
Regards
Utsav
Solved! Go to Solution.
It looks you have converted [open rate] as percentage from ribbon like below:-
You can update your color format code with below:-
color_format =
IF (
( [active_accounts] * 100 ) < 15,
"red",
IF (
( [active_accounts] * 100 ) > 15
&& ( [active_accounts] * 100 ) < 20,
"orange",
IF ( ( [active_accounts] * 100 ) > 20, "green" )
)
)
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
You need to create a measure with below code and use it in background color as field value.
color_format =
if(
[active_accounts]<15,"red",
if([active_accounts]>15 && [active_accounts]<20,"orange",
IF([active_accounts]>20,"green")))
Note:- Pass your required column which you bringing on card in place of [active_accounts]
Now in click on fx icon in backgroud of visual format pane
Select format by field value and select newly created measure
You will see below as output:-
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
It looks you have converted [open rate] as percentage from ribbon like below:-
You can update your color format code with below:-
color_format =
IF (
( [active_accounts] * 100 ) < 15,
"red",
IF (
( [active_accounts] * 100 ) > 15
&& ( [active_accounts] * 100 ) < 20,
"orange",
IF ( ( [active_accounts] * 100 ) > 20, "green" )
)
)
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Just a question, out of curiocity. Suppose I have 3 - 4 other fileds like that and I want to apply sme rule for them, but the values will be different from this one.
Can I create some other color format codes with different name and use those in same way?
Regards
Utsav
Yes you can do in this way.
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
BINGO.
Thanks Buddy.
It appears that you are looking at the right place to format the color. Without looking at data or calculation, it would be difficult to suggest. If it's not sensitive data, please share the PBIX file.
Thanks!
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 |
---|---|
111 | |
95 | |
77 | |
68 | |
54 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |