Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Issue with Conditional Formatting in Matrix Visual

Hi Team,

Hope you're all doing well.

I was working on applying conditional formatting in the Matrix visual, where I have a column called "ppk" and I am applying the following criteria to achieve color coding using DAX.

Using this DAX (with averages included):

 

DAX
PPK_Conditional_Color_heatmap = 
VAR Ppk_Value = AVERAGE('PPK'[ppk_vl]) // No COALESCE applied
VAR StdDev_Value = AVERAGE('PPK'[stddev_vl]) // No COALESCE applied
RETURN
SWITCH(
TRUE(),
Ppk_Value = 0 && StdDev_Value = 0, "#808080", // Grey for NULL Ppk & StdDev is Blank
Ppk_Value = 0 && StdDev_Value = 0, "#ADD8E6", // Light Blue for NULL Ppk & StdDev = 0
Ppk_Value >= 1.33, "#69b764", // Green
Ppk_Value >= 1.00 && Ppk_Value < 1.33, "#ffc156", // Yellow
Ppk_Value < 1.00, "#d82526" // Red
)

The criteria for coloring are as follows:

  • Ppk >= 1.33 → Green
  • Ppk >= 1.00 && Avg_Ppk < 1.33 → Yellow
  • Ppk < 1.00 → Red
  • PPK = NULL & StdDev_Vl = 0 → Light Blue
  • PPK = NULL & StdDev_Vl = Blank → Grey

    However, after applying the formula, the grey and light blue colors are not showing as expected. I believe the issue is that when the cell is empty, the conditional formatting is not triggering. This might be because blank values aren’t being accounted for correctly in the DAX expression.

    azeenk_0-1742221916208.png

     

     

    Has anyone encountered this issue, or do you have any suggestions on how to address it?

     

    Looking forward to your inputs.

    Thanks & Regards,
    Hk

5 REPLIES 5
v-sgandrathi
Community Support
Community Support

Hi  @Anonymous,

 

I wanted to check if you had the opportunity to follow up on previous conversation provided by community member. If yes can you please provide the sample data so that we can provide you with the accurate and correct solution. 

Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.

 

Thank you.

Hi @Anonymous,

 

As we did not get a response, may I know if the above reply could clarify your issue, or could you please help confirm if we may help you with anything else?

 

And if the provided information meets your requirements, you can Accept the solution and also give Kudos on that reply. It helps other users who are searching for this same information and find the information.

 

Your understanding and patience will be appreciated.

Pow3Range
Frequent Visitor

Could you please share a PBIX file with sample (non-confidential) data? This will help in understanding the issue better and providing a more accurate solution. You can remove or anonymize any sensitive information before sharing

Deku
Super User
Super User

try 

PPK_Conditional_Color_heatmap = 
VAR Ppk_Value = AVERAGE('PPK'[ppk_vl]) // No COALESCE applied
VAR StdDev_Value = AVERAGE('PPK'[stddev_vl]) // No COALESCE applied
RETURN
SWITCH(
TRUE(),
ISBLANK(Ppk_Value) && ISBLANK(StdDev_Value), "#808080", // Grey for NULL Ppk & StdDev is Blank
ISBLANK(Ppk_Value) && StdDev_Value = 0, "#ADD8E6", // Light Blue for NULL Ppk & StdDev = 0
Ppk_Value >= 1.33, "#69b764", // Green
Ppk_Value >= 1.00 && Ppk_Value < 1.33, "#ffc156", // Yellow
Ppk_Value < 1.00, "#d82526" // Red
)

Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
Anonymous
Not applicable

Hi @Deku ,

Thanks for your response,

I tried but still its coming as previous dax results.

azeenk_0-1742228000786.png

 

If there are any other solutions, please help me with it.

 

Thanks in advance!

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.