The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi Everyone,
I have to color format based on range as shown in below image, If it is 0-20 then Green, 20-30 then Amber and > 30 then red. But when i try to use FX in color format then if i select a column (particular range) then it will take aggregate automatically as shown in 2nd image.
And also,I tried to write a measure, but measure doesn't read column directly, so i can't able to write it.
Please help me how to do color format in this scernario. Its very urgent.
Solved! Go to Solution.
Hi @krishb1414 ,
Here are the steps you can follow:
1. Create measure.
Color =
SWITCH(
TRUE(),
MAX('Table'[Range])="0-20","#4CAF50",
MAX('Table'[Range])="20-30","#FFC107",
MAX('Table'[Range])="30-100","#f44336")
2. Go to the Background color interface.
Format style – Field value
Select [Color]
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @krishb1414 ,
Here are the steps you can follow:
1. Create measure.
Color =
SWITCH(
TRUE(),
MAX('Table'[Range])="0-20","#4CAF50",
MAX('Table'[Range])="20-30","#FFC107",
MAX('Table'[Range])="30-100","#f44336")
2. Go to the Background color interface.
Format style – Field value
Select [Color]
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi,
It means you entered values statically in measure, what if I change values in column (Range Column)
For example Instaed of "0-20" to "0-10" or "20-30" to "10-20". It will be blank or no color right.
So, what do i do in such scenario ?
Please help me in this cases.
Hey @krishb1414 ,
I must admit that I do not understand what you want to achieve. Please provide a pbix file that contains sample data but still reflects your data model (tables, relationships, calculated columns, and measures). Upload the pbix to onedrive, google drive, or dropbox and share the link. Describe the requirement based on the sample data you provide.
If you want to keep your solution more dynamic, then it is helpful creating a table that contains two columns (left bound and right bound) instead of a single column.
I'm also wondering about the color you want to use if the value is
20,
30 or above
100.
Regards,
Tom
User | Count |
---|---|
69 | |
68 | |
65 | |
54 | |
28 |
User | Count |
---|---|
112 | |
82 | |
65 | |
48 | |
43 |