Forum Discussion
Conditional formatting for each matrix row
- 3 years ago
I have uploaded a test .pbix file that are working.Does not look like I have possibilites to upload the file. If needed, I can email it to you. Please let me know.
My measure looks like this: (Could you try to change yours as well, and use AND () instead of &.Color measure =SWITCH (TRUE(),AND ( SELECTEDVALUE('Table'[Vendor]) = "Vendor1", SUM ( 'Table'[Value] ) = 100 ), "#e30b5d",AND ( SELECTEDVALUE('Table'[Vendor]) = "Vendor2", SUM ( 'Table'[Value] ) = 200 ), "#8e4585",AND ( SELECTEDVALUE('Table'[Vendor]) = "Vendor3", SUM ( 'Table'[Value] ) = 150 ), "#077106",AND ( SELECTEDVALUE('Table'[Vendor]) = "Vendor4", SUM ( 'Table'[Value] ) = 300 ), "#09387f",AND ( SELECTEDVALUE('Table'[Vendor]) = "Vendor5", SUM ( 'Table'[Value] ) = 200 ), "#5851db")I have added a snipping tool of the result, and it works as expected.Br
Marius
In the table/matrix where you gonna have the conditional formatting, put the color measure in the value field. Just to ensure its not throwing a error measure.
This is for debugging purpose only
This is the error I got
"Calculation error in measure 'npa_invtry_qty'[Color measure]: DAX comparison operations do not support comparing values of type True/False with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values."
This is my DAX
- mariussve13 years agoSolution Sage
I have uploaded a test .pbix file that are working.Does not look like I have possibilites to upload the file. If needed, I can email it to you. Please let me know.
My measure looks like this: (Could you try to change yours as well, and use AND () instead of &.Color measure =SWITCH (TRUE(),AND ( SELECTEDVALUE('Table'[Vendor]) = "Vendor1", SUM ( 'Table'[Value] ) = 100 ), "#e30b5d",AND ( SELECTEDVALUE('Table'[Vendor]) = "Vendor2", SUM ( 'Table'[Value] ) = 200 ), "#8e4585",AND ( SELECTEDVALUE('Table'[Vendor]) = "Vendor3", SUM ( 'Table'[Value] ) = 150 ), "#077106",AND ( SELECTEDVALUE('Table'[Vendor]) = "Vendor4", SUM ( 'Table'[Value] ) = 300 ), "#09387f",AND ( SELECTEDVALUE('Table'[Vendor]) = "Vendor5", SUM ( 'Table'[Value] ) = 200 ), "#5851db")I have added a snipping tool of the result, and it works as expected.Br
Marius
- sridhar713 years agoHelper I
please email it to [email protected]
- mariussve13 years agoSolution Sage
I have now emailed you the working .pbix file as agreed 🙂
BrMarius
- sridhar713 years agoHelper I
You are a genius.
it is working now