Forum Discussion

VEG_Admin's avatar
VEG_Admin
Frequent Visitor
7 years ago
Solved

Conditional formatting multiple columns in matrix separately

I have a matrix with multiple columns, and I'd like the conditional formatting to apply to each column separately, instead of to the entire matrix.  The current result I have formats the background red to green, but since one column has a large number in it that one value is red and the entirety of the rest of the matrix, not just the column with the large number, is green.  Is this possible?

 

  • hi, VEG_Admin 

    Sorry for my careless, you could try this formula for [$/SF/CostCode]

    $/SF/CostCode = RANKX(ALLSELECTED('Buildings'[Building Name]),[$/SF],,ASC)

    Result:

     

    By the way, in the 4th column, these three 0.01 values are different value indeed, please put four decimal places for [

    $/SF

    ].

     

     

    Best Regards,

    Lin

11 Replies

  • Hey,

     

    I'm not sure if totally understand your requirement, but I think what you are looking for can be achieved following this article https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-formatting-by-field-value (conditional formatting by field value).

     

    If this does not provide what you are looking for, please consider to alaborate more on the issue and also consider to prepare a pbix/xlsx file that contains sample data but represents your data model and upload the the file(s) to onedrive or dropbox and share the link.

     

    Hopefully this is what you are looking for.

     

    Regards,

    Tom

    • VEG_Admin's avatar
      VEG_Admin
      Frequent Visitor

      Tom,

       

      Thanks for the quick reply.  Sorry my previous post wasn't clear.  Here is the result I'm getting:

       

      This is a matrix where Building is the Rows field, Cost code (1,2,3,4) is the Columns field, and $/SF is the Values field.  I am trying to see where there is a delta between buildings for each cost code, however, the large values in cost code 4 are skewing the entire matrix. so you don't see that there is a "relatively" large delta in cost code 1.  I'd like cost code 1 to look like this:

      But to be included in the matrix as a whole, so that each column is formatted based on the range of values in that column, not the range of values in the entire matrix.

       

      We don't have a non-secure share option, and I don't see a way to load the file on this site, but here is my sample data:

      Thanks for the assistance.  It is really appreciated.

      • v-lili6-msft's avatar
        v-lili6-msft
        Community Support

        HI, VEG_Admin 

        Just try this way as below:

        Step1:

        Create a measure

        Measure for formatting = CALCULATE(SUM('Table'[$/SF]),ALLSELECTED('Table'[Cost Code]))

        Step2:

        When creating Conditional formatting, choose this measure for "Based on field"

        Result:

         

        Best Regards,

        Lin