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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
azeenk
Helper I
Helper I

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
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!

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.