Forum Discussion
Matrix Row Conditional Formatting
- 3 months ago
Hi ml0911 ,
Apologies for asking again but there must be something in your model that is impacting the relationships or the calculations.
On a previous post you refer:"I just removed a blank row from this table and now it allowing a "one to many" relationship, however this has not fixed the issue with the cells not highlighting."
If now you have a one to many relationship using the values from the one side and making the format has reference you should get the colors on all the rows even for blank values because the context is now the dimension table.
- 3 months ago
Hi ml0911 ,
The issue occurs because the conditional formatting measure uses SELECTEDVALUE(), which can return BLANK and prevent coloring in some cells. Switching to MAX() in your color measure will ensure consistent formatting across the row, including for cells with 0.
RowColor =
VAR Dept =
MAX('Group Names'[Simple Group Names])
RETURN
SWITCH(
TRUE(),
Dept = "DPD", "#D9E1F2",
Dept = "UPD", "#E2EFDA",
Dept = "TT", "#FFF2CC",
"#FFFFFF"
)Then keep your conditional formatting set to Format by Field value and use this RowColor measure. This approach ensures the color is applied consistently across all cells in the row, including those displaying 0.
Hi ml0911 ,
What is the type of relationship you have between the tables?
Can you share a print screen of the relationships to check how is setup.
Is this what you're looking for?
Thank you for your help again
- MFelix4 months agoSuper User
Hi ml0911 ,
This explains the result you are having you need to have a one-to-many relationship for this to work in the proper way like I refered.
My question is on the Group names table the column that makes the relationship has a single value for each department or you can have several departments repeated?
- ml09114 months agoRegular Visitor
The column in the group names table does not have any repeated values. However, when I try to change the relationship to "one to many" PowerBI is not allowing this and automatically changes it back to "many to many".
- ml09114 months agoRegular Visitor
I just removed a blank row from this table and now it allowing a "one to many" relationship, however this has not fixed the issue with the cells not highlighting.