Conditional format a matrix table based on another column


Im trying to colour coder the background of each order in this matrix table based on its pending operation field.

I wrote the formula below to test it but cnat get it to work what am i missing? Basically i planned to convert each text pending operation value to a number then simply conditional format the order numbers in the table based on the given number.

If you hoover over each order number you can see the locations i just cant get them colored.

PBIX attached also

Pending Operation Number =

VAR PendingOperation = SELECTEDVALUE( ‘SAP Ageing’[Pending Operation] )



PendingOperation = " CNC MACHINING " = 1,

PendingOperation = " FINISHING " = 2


Power Bi Planning LOB.pbix (923.1 KB)

You had some errors in your Measure. I have attached a version of the PBIX where I corrected this for you. If you go into the conditional formatting area under rules for Background Color & Font Color you will se how I applied the measure to get the results I did. When creating a measure like this it is imperative if you are using text that you do not include extra spacing. Also in your original measure you had an = sign after you text, when it should have been a coma.


Power Bi Planning LOB (3).pbix (919.1 KB)


1 Like

Many thanks !!! is there any way to tie this into a secondary table that has a list of pending operations and a index number? rather than having to type all these into a code?

1 Like

Potentially you could by the sound of it, but will probably need to know a little bit more about how you’re thinking of setting this up.

Why not give it a go first and see where you get to, and then come back and get support if it doesn’t work out as you thought it would.

Certainly review the video tutorials on secondary tables to really understand the formula techniques you need to utilise if this is the road you want to go down.