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

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

Reply
Imrans123
Advocate V
Advocate V

DAX Conditional Formatting, return blank icon

Was wondering if anyone could help. 

 

I have a table with rows of metrics, and for each metric I have a Current year measure and a previous year measure. 

 

I have a matrix where the rows are metric name and for each row, I want to conditionally format based on whether current year is greater than previous year. Take the below example for reference,

 

IF(

 HASONEVALUE('Metric'[Metric Name])

SWITCH (

 VALUES ('Metric'[Metric Name]),

"Sales", IF([Sales]>[Sales PY], "TriangleHigh","TriangleLow"), 

"Expenses",IF([Expenses]<[Expenses PY], "TriangleHigh","TriangleLow"),

"Profit",IF([Profit]>[Profit PY],  "TriangleHigh","TriangleLow"),

"TriangleMedium"

))

 

This works exactly the way I want it to. However, if I have a metric I did not list in the above measure but is in the metric name column, for that metric, it shows the triangle medium icon. 

 

I would like to make it such that if a metric not mentioned above is present, then to just not show any icon whatsoever. I tried changing the measure to 

 

IF(

 HASONEVALUE('Metric'[Metric Name])

SWITCH (

 VALUES ('Metric'[Metric Name]),

"Sales", IF([Sales]>[Sales PY], "TriangleHigh","TriangleLow"), 

"Expenses",IF([Expenses]<[Expenses PY], "TriangleHigh","TriangleLow"),

"Profit",IF([Profit]>[Profit PY],  "TriangleHigh","TriangleLow"),

""

))

 

However, it just shows a broken image link for the metrics not mentioned. 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Imrans123 , try blank

 

IF(

HASONEVALUE('Metric'[Metric Name])

SWITCH (

VALUES ('Metric'[Metric Name]),

"Sales", IF([Sales]>[Sales PY], "TriangleHigh","TriangleLow"),

"Expenses",IF([Expenses]<[Expenses PY], "TriangleHigh","TriangleLow"),

"Profit",IF([Profit]>[Profit PY], "TriangleHigh","TriangleLow"),

blank()

))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Imrans123 , try blank

 

IF(

HASONEVALUE('Metric'[Metric Name])

SWITCH (

VALUES ('Metric'[Metric Name]),

"Sales", IF([Sales]>[Sales PY], "TriangleHigh","TriangleLow"),

"Expenses",IF([Expenses]<[Expenses PY], "TriangleHigh","TriangleLow"),

"Profit",IF([Profit]>[Profit PY], "TriangleHigh","TriangleLow"),

blank()

))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Perfect! Thanks!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.