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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
azeenk
Frequent Visitor

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  @azeenk,

 

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 @azeenk,

 

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
Community Champion
Community Champion

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!
azeenk
Frequent Visitor

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.