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
AlexChitan
New Member

PowerBI - conditional formatting specific column section in matrix

Hi 

 

I have simplified my matrix table to the below.

Am I able to apply conditional formatting to the Variance section only? I want values to show as red for a negative variance and green for a positive variance. I can't find anything online that suggests you can.

 

AlexChitan_0-1720526137332.png

 

Thanks

A

1 ACCEPTED SOLUTION
techhet23
Regular Visitor

Hello @AlexChitan

As there is no straightforward solution to your problem, I have tried a workaround solution and it works well.

I tried to apply conditional formatting to cell using measure, where we can specify our "Variance" section condition effectively.

 

techhet23_0-1720528412263.png

Have a look at all the 3 measures,
cf_variance_profit = IF(AND(VALUES(Sheet2[Quarter]) = "Variance", SUM(Sheet2[Profit]) >= 0), "#AFE1AF", IF(VALUES(Sheet2[Quarter]) = "Variance", "#E34234"))
cf_variance_cost = IF(AND(VALUES(Sheet2[Quarter]) = "Variance", SUM(Sheet2[Cost]) >= 0), "#AFE1AF", IF(VALUES(Sheet2[Quarter]) = "Variance", "#E34234"))
cf_variance_markup% = IF(AND(VALUES(Sheet2[Quarter]) = "Variance", SUM(Sheet2[Mark up %]) >= 0), "#AFE1AF", IF(VALUES(Sheet2[Quarter]) = "Variance", "#E34234"))
 
Hope this solves your problem, if it did don't forget to mark this as a solution.

View solution in original post

3 REPLIES 3
selda
New Member

Hello,

I need help about matrix column totals.

I would like to have these kind of view but I can not view column total for each month .

gross sales, domestic sales... are measures on rows.

do you have an idea?

thanks 

selda_0-1725652955556.png

 

techhet23
Regular Visitor

Hello @AlexChitan

As there is no straightforward solution to your problem, I have tried a workaround solution and it works well.

I tried to apply conditional formatting to cell using measure, where we can specify our "Variance" section condition effectively.

 

techhet23_0-1720528412263.png

Have a look at all the 3 measures,
cf_variance_profit = IF(AND(VALUES(Sheet2[Quarter]) = "Variance", SUM(Sheet2[Profit]) >= 0), "#AFE1AF", IF(VALUES(Sheet2[Quarter]) = "Variance", "#E34234"))
cf_variance_cost = IF(AND(VALUES(Sheet2[Quarter]) = "Variance", SUM(Sheet2[Cost]) >= 0), "#AFE1AF", IF(VALUES(Sheet2[Quarter]) = "Variance", "#E34234"))
cf_variance_markup% = IF(AND(VALUES(Sheet2[Quarter]) = "Variance", SUM(Sheet2[Mark up %]) >= 0), "#AFE1AF", IF(VALUES(Sheet2[Quarter]) = "Variance", "#E34234"))
 
Hope this solves your problem, if it did don't forget to mark this as a solution.

Amazing this has worked. Thank you!

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.