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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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