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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.