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
Elizz , Try a measure like below with conditional formatting with the field Value option
TCI Color Formatting =
VAR Status = Max('StatusTable'[TCI Status])
VAR Weeks = Max('FactTable'[Weeks Wait]) // Assuming the COlumn on Matrix
RETURN
SWITCH(TRUE(),
Status = "TCI after Breach", "#FF0000", // Red
Status = "PastTCI", "#FF0000", // Red
Status = "TCI before Breach" && Status = "Pending" && Weeks < 6, "#0070C0", // Blue
Status = "TCI before Breach" && Status = "Pending" && Weeks >= 6, "#FF0000", // Red
BLANK()
)