Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
I am trying to format a matrix so that the color of the row is tied to the department name. However, it is not applying the color to any values that are 0. See below:
I would like the entire row highlighted in the specified colors, even fields that are 0. I have one measure for specifying the row color and a second measure that forces blank values to be 0 because PowerBI was previously populating as blanks. See both below.
Solved! Go to Solution.
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.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @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.
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.
Are you able to Share a copy of the file?
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsInstead of fixing blanks in a separate step, make the displayed measure itself return 0:
Displayed Value =
COALESCE ( [Your Measure], 0 )
ALso your color logic is fine, but use it as Format by: Field value on the values in the matrix.
I am using it as Format by: Field value. That's how I'm able to change the colors of the rows.
As far as the coalesce function, how is that any different from the +0 method? You're still fixing blanks in a separate step with an additional measure.
I'm not really sure what a fact table or dimension table is. Sorry. The group names table is a separate table from the one where the matrix is pulling the 'Actual Hrs' values from. They are linked by the department name value.
Hi @ml0911 ,
The fact table is where you have all the information for you calculations in this case the Export Table and Dimension tables describe business entities.
Check this link about this concepts (https://learn.microsoft.com/en-us/power-bi/guidance/star-schema#star-schema-overview)
Concerning the relationship are they done with a one to many relationship?
Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.
If the information is sensitive please share it trough private message.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThank you for the explanation. That makes sense. It is a "many to many" relationship. I cannot share the data as it is confidential. Do you know of a workaround for this issue?
Hi @ml0911 ,
Is the Group Names your Fact table or is it a dimension table connected to your fact? This usually happens because the result of the query is an empty value and does not shows in the "virtual table" that is part of visual.
In the examples below I have the same matrix however one is with the values from the fact and the other is the values from the dimension:
What happens is altough you have a value of 0 in the visualization in this case the value Brazil does not exist in the fact table so no result is given for the condittional formatting.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCheck out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 45 | |
| 38 | |
| 34 | |
| 21 | |
| 17 |
| User | Count |
|---|---|
| 65 | |
| 62 | |
| 31 | |
| 26 | |
| 25 |