Forum Discussion

AlexChitan's avatar
AlexChitan
New Member
2 years ago
Solved

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

  • 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.

3 Replies

  • techhet23's avatar
    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.

     

    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.
  • selda's avatar
    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