Forum Discussion
AlexChitan
2 years agoNew 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 p...
- 2 years ago
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.
techhet23
2 years agoRegular 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.
AlexChitan
2 years agoNew Member
Amazing this has worked. Thank you!