Forum Discussion
Conditional Format when value does not equal same row value in another column (Matrix)
Hi melimob1 ,
Thanks for Bibiano_Geraldo and FreemanZ reply.
First you can try the follwing code
SameProductMeasure =
VAR ProductsList =
CALCULATETABLE(
VALUES('Table'[Product]),
ALLEXCEPT('Table', 'Table'[Country])
)
VAR HasUnspecified =
CALCULATE(
COUNTROWS('Table'),
'Table'[Product] = "UNSPECIFIED",
ALLEXCEPT('Table', 'Table'[Country])
)
RETURN
IF(
SELECTEDVALUE('Table'[Company]) = "CompanyA",
IF(
HasUnspecified > 0,
"brown",
IF(
COUNTROWS(ProductsList) = 1,
"Red",
"Green"
)
)
)
Right click the values and set conditional format
Final output
Secondly there is no way to customize the formatting of line headings in power bi. However, if you want to show the same rows, you can create a new table visualization to show the corresponding cases
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- melimob11 year agoHelper I
Hey, thank you also for your reply. It's given me a result but unfortunatley, not exactly what I need.
If in Australia, Company A has the same product as company B, then show as green.
I have instances in this result where it's showing green and they don't match 😞
thank you so much anyhow!
- Anonymous1 year agoNot applicable
Hi melimob1 ,
Thanks for your reply, can you show more sample data so that we can correct our logic of the code. Please hide sensitive information in advance.
Best regards,
Albert He