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
AjayBI55
Frequent Visitor

Heatmap on Matrix Visual as per specified format

Hello,

 

I wanted to create a heatmap on Matrix Visual depends on below specified format. For that we need create Probability and Imapct columns as per below given rules. 

Expected Matrix Visual:

AjayBI55_3-1681793591742.png

Rules:

AjayBI55_0-1681793073004.png

The Risk table as below and i have calculated cost /sales price and riskscore using risk table.

Risk Table:

AjayBI55_1-1681793172097.png 

Calculated columns:

AjayBI55_2-1681793392039.png

 

I have created a BG colour column using DAX. But it doesn't give result as per expected visual. 

My result matrix Chart

AjayBI55_4-1681793812083.png

Fields

AjayBI55_5-1681793847694.png

 

Imapct Calculated column DAX

Impact = var cost = SUMX(RELATEDTABLE('sales price'),risks[cost]/'sales price'[sales price]) *100
return
SWITCH(TRUE(),
cost>=1,"Very High Impact",
cost>=0.5,"High Impact",
cost>=0.25,"Medium Impact",
cost>=0.1,"Low Impact","Very Low Impact")
 
Probabilty Calculated column DAX
Probabilty = SWITCH(TRUE(),
risks[likehood] >=40,"Highly Probable",
risks[likehood] >=30,"Probable",
risks[likehood] >=20,"Possible",
risks[likehood] >=10,"Unlikely","Rare")
 
BG Colour Calculated column DAX
BG_Colour_Column = var cost = SUMX(RELATEDTABLE('sales price'),risks[cost]/'sales price'[sales price]) *100
RETURN
SWITCH(TRUE(),
COST<0.1 && risks[likehood] >=40, "#ffff00",
COST<0.1 && risks[likehood] >=30, "#ffff00",
COST<0.1 && risks[likehood] >=20, "#008000",
COST<0.1 && risks[likehood] >=10, "#008000",
COST<0.1 && risks[likehood] <10, "#008000",

COST>=0.1 && risks[likehood] >=40, "#FFA500",
COST>=0.1 && risks[likehood] >=30, "#ffff00",
COST>=0.1 && risks[likehood] >=20, "#ffff00",
COST>=0.1 && risks[likehood] >=10, "#ffff00",
COST>=0.1 && risks[likehood] <10, "#008000",

COST>=0.25 && risks[likehood] >=40, "#FFA500",
COST>=0.25 && risks[likehood] >=30, "#FFA500",
COST>=0.25 && risks[likehood] >=20, "#ffff00",
COST>=0.25 && risks[likehood] >=10, "#ffff00",
COST>=0.25 && risks[likehood] <10, "#008000",

COST>=0.5 && risks[likehood] >=40, "#FF0000",
COST>=0.5 && risks[likehood] >=30, "#FFA500",
COST>=0.5 && risks[likehood] >=20, "#FFA500",
COST>=0.5 && risks[likehood] >=10, "#ffff00",
COST>=0.5 && risks[likehood] <10, "#ffff00",

COST>=1 && risks[likehood] >=40, "#FF0000",
COST>=1 && risks[likehood] >=30, "#FF0000",
COST>=1 && risks[likehood] >=20, "#FFA500",
COST>=1 && risks[likehood] >=10, "#FFA500",
COST>=1 && risks[likehood] <10, "#ffff00")

 

Could you please help me...

 

Best

Ajay

 

1 REPLY 1
lbendlin
Super User
Super User

You are nearly there.  (you should do the color coding in Power Query, not in DAX)

 

Remember that to report on things that are not there you need to use disconnected tables and/or crossjoins.  Otherwise you won't get background colors for BLANK() cells.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.