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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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.

Thanks

A

1 ACCEPTED SOLUTION
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.

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.
2 REPLIES 2
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.

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

Amazing this has worked. Thank you!

## Helpful resources

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Join our Community Sticker Challenge

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

#### Power BI Monthly Update - July 2024

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

#### Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors