Forum Discussion
Color Coding Specific data in a Matrix.
I have a matrix and need certain things to come with a color background. I am fairly new to BI and conditional formatting is not my strong suit. Any help would be greatly appreciated. Example. ESC should be Gray, ACC should be Blue etc. Thank you in advance for any help.
Hi JChouris ,
According to your description, here's my solution, create a measure.
Color = SWITCH ( MAX ( 'Table'[Resets] ), "ESC", "Gray", "ACC", "Blue" )In the visual formatting pane>Visual>Cell elements, turn on the Backgroud color option, and select fx button.
Select the color measure in the field.
Ge the correct result.
More information about conditional formatting, you can refer to this documnet:
Apply conditional table formatting in Power BI - Power BI | Microsoft Docs
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
10 Replies
- lbendlinSuper User
What have you tried and where are you stuck?
Please provide sanitized sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided. - JChourisHelper I
I tried conditional formating but it seems to only allow for numerical formating. I need to color format the terms in the cells.
- JChourisHelper I
This is the database i draw from. Each Reset needs a color coding. Just unsure how to conditional format these as they are not numerical values. I need them to show up colored
- lbendlinSuper User
Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - lbendlinSuper User
Easiest would be to create a reference table with each Reset value and the color name of the color you want to assign to that Reset. Tie that table into the data model and then use the color field for the formatting - use any aggregation your want, for example max([color])
- JChourisHelper I
Not really sure how to go about doing that. Sorry still really new to this and might have bitten off more than i can chew with this project.
- JChourisHelper I
Here is a sample of the table i draw these specs from.
Resets Reset ID Description ESC 1 Electronic Stability Control - Optional Feature - Reset Required if present. Use OEM scan tool (No Codelink Support Yet) ESC* 2 Electronic Stability Control - Reset Required - Standard Feature. Use OEM scan tool (No CL Support Yet) ESC► 3 Electronic Stability Control - Optional Feature - Reset Required if present. Use CodeLink or OEM scan tool ESC→ 4 Electronic Stability Control - Reset Required - Standard Feature. Use CodeLink or OEM scan tool EPS 5 Electronic Power Steering - Optional Feature - Reset Required if present. Use OEM scan tool (No Codelink Support Yet) EPS* 6 Electronic Power Steering - Reset Required - Standard Feature. Use OEM scan tool (No CL Support Yet) EPS► 7 Electronic Power Steering - Optional Feature - Reset Required if present. Use CodeLink or OEM scan tool EPS→ 8 Electronic Power Steering - Reset Required - Standard Feature. Use CodeLink or OEM scan tool ACC 9 Adaptice Cruise Control - Optional Feature - Reset Required if present. Use OEM scan tool (No Codelink Support Yet) ACC* 10 Adaptice Cruise Control - Reset Required - Standard Feature. Use OEM scan tool (No CL Support Yet) ACC► 11 Adaptice Cruise Control - Optional Feature - Reset Required if present. Use CodeLink or OEM scan tool ACC→ 12 Adaptice Cruise Control - Reset Required - Standard Feature. Use CodeLink or OEM scan tool AEB 13 Automatic Emergency Braking - Optional Feature - Reset Required if present. Use OEM scan tool (No Codelink Support Yet) AEB* 14 Automatic Emergency Braking - Reset Required - Standard Feature. Use OEM scan tool (No CL Support Yet) AEB► 15 Automatic Emergency Braking - Optional Feature - Reset Required if present. Use CodeLink or OEM scan tool AEB→ 16 Automatic Emergency Braking - Reset Required - Standard Feature. Use CodeLink or OEM scan tool EPS³ 17 Electronic Power Steering - Reset Required - Standard Feature Use CodeLink or OEM Scan Tool EPS³☼ 18 Electronic Power Steering - Reset Required - Standard Feature Use CodeLink or OEM Scan Tool (Requires CodeLink OEM expansion cable) EPS³► 19 Electronic Power Steering - Reset Required - Standard Feature Use CodeLink or OEM Scan Tool EPS³☼ 20 Electronic Power Steering - Reset Required - Standard Feature. Use CodeLink or OEM scan tool - v-yanjiang-msftCommunity Support
Hi JChouris ,
According to your description, here's my solution, create a measure.
Color = SWITCH ( MAX ( 'Table'[Resets] ), "ESC", "Gray", "ACC", "Blue" )In the visual formatting pane>Visual>Cell elements, turn on the Backgroud color option, and select fx button.
Select the color measure in the field.
Ge the correct result.
More information about conditional formatting, you can refer to this documnet:
Apply conditional table formatting in Power BI - Power BI | Microsoft Docs
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- JChourisHelper I
It works great .Thank you so much.