Forum Discussion
Condition formatting
- 1 year ago
Hi Akbera1
Can you please try this ?
Create a measure and use conditional formatting.ValueColor =SWITCH(TRUE(),MAX('Table'[Type]) = "A" && MAX('Table'[Values]) < 0.10, "#FF0000", -- RedMAX('Table'[Type]) = "A" && MAX('Table'[Values]) >= 0.10, "#00FF00", -- GreenMAX('Table'[Type]) = "B" && MAX('Table'[Values]) < 0.05, "#FF0000", -- RedMAX('Table'[Type]) = "B" && MAX('Table'[Values]) >= 0.05, "#00FF00", -- GreenBLANK())
If this answers your questions, kindly accept it as a solution and give kudos.
Hi Akbera1 ,
Thank you for reaching out to Microsoft fabric community.
Thanks for sharing your requirement. I’ve implemented the solution and validated it against your logic. Here's how I achieved it:
The data has been loaded and includes the following columns: Type, Materials, and Values, with the Values presented as decimal percentages.
Created a DAX Measure to return color codes based on conditions:
Color Format =
SWITCH(
TRUE(),
SELECTEDVALUE('Table'[Type]) = "A" && SELECTEDVALUE('Table'[Values]) <> 0.1, "#FF0000",
SELECTEDVALUE('Table'[Type]) = "B" && SELECTEDVALUE('Table'[Values]) > 0.05, "#00FF00",
SELECTEDVALUE('Table'[Type]) = "B" && SELECTEDVALUE('Table'[Values]) <= 0.05, "#FF0000",
BLANK()
)
I’ve applied Conditional Formatting to the Values column -
Open the table visual, click the dropdown on the Values field, then select Conditional Formatting and choose Background color.
Set Format by to Field value, and for Based on field, select the Color Format measure.
Please find the attached .pbix file for your reference.
Regards,
Sreeteja.
Hi Akbera1 ,
I hope the information provided above assists you in resolving the issue. If you have any additional questions or concerns, please do not hesitate to contact us. We are here to support you and will be happy to help with any further assistance you may need.
- v-sshirivolu1 year agoCommunity Support
Hi Akbera1 ,
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you
- v-sshirivolu1 year agoCommunity Support
Hi Akbera1 ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions