Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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):
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:
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.
Has anyone encountered this issue, or do you have any suggestions on how to address it?
Looking forward to your inputs.
Thanks & Regards,
Hk
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.
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
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
)
Hi @Deku ,
Thanks for your response,
I tried but still its coming as previous dax results.
If there are any other solutions, please help me with it.
Thanks in advance!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
14 | |
12 | |
11 | |
10 | |
8 |