Forum Discussion
Matrix table conditional format based on row and column fields not values
- 1 year ago
Hi Elizz
Thanks for reaching out to the Microsoft fabric community forum.
Create Conditional Formatting DAX Measure -
MatrixCellColor =
VAR _Status = SELECTEDVALUE(Appointments[Status])
VAR _Week = SELECTEDVALUE(Appointments[Week])
RETURN
SWITCH(
TRUE(),
_Status = "TCI After Breach", "#FF6B6B",
_Status = "PastTCI", "#FF6B6B",
_Status = "TCI Before Breach", "#5DADE2",
_Status = "Pending" && _Week <= 5, "#5DADE2",
_Status = "Pending" && _Week > 5, "#FF6B6B",
"#FFFFFF"
)
Apply Conditional Formatting
In Visualizations pane go to Values - dropdown - Conditional formatting - Background colorSelect :
Format by: Field value
Based on field: MatrixCellColor
Please find the below attached .pbix file for your reference.
Regards,
Sreeteja
thanks, but when i select the Dax measure it doesnt let me select it. it wont allow me to select any measures only fields. i do have a measure in my value as it sums all 3 fact tables (waitlists) together.
Hi Elizz ,
I'm able to select the measure for conditional formatting, as you can see in the screenshot below.
Key Checks Before Applying Conditional Formatting with a Measure
Make sure that your DAX measure is returning a text value (like a hex color code) and was created using "New measure", not a column. Also, ensure you're formatting the correct value field in the matrix.
- Elizz1 year agoFrequent Visitor
Hi, thank you
i can select the measure but it wont apply. i think it could be to do with the version i am on, i can select the measure if i opt for Rules instead if field value but of course that needs to be a number format. I am also not doing just a sum of the value in the value, i have a measure called WL which i have left in the formula bar as i need to count all 3 different waitlists
- danextian1 year agoSuper User
Are you perhaps using live connection? Because this setup wont accept a measure that is created locally to be used for conditional formatting. If not, can you show put this measure in a matrix?
- Elizz1 year agoFrequent Visitor
Hi
I am just using desktop, import connection...and will publish on our server, we do not have the cloud.
not sure what you mean by putting this measure in a matrix, this measure= MatrixCellColor ? i thought matrix needed values/numbers so this did not work.
liz