Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Use Matrix column subtotal with measure to perform conditional formatting

Hi,

 

I have a matrix which i have turned on column subtotals. I would like to highlight the row (conditional formatting) if the subtotal is less than a measure.

 

 

If the measure returns 12, i am trying to change the background colour of the rows john and frank yellow

  • Hi Anonymous ,

     

    Create a measure to get the subtotal by user:

    Subtotal by User =
    CALCULATE ( SUM ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[user] ) )
    

    You can now then use this measure in conditional formatting based on rules

    Alternatively, you can use another conditional formatting measure and format based on field value

    Conditional Formatting = 
    IF ( [Subtotal by User] <= 12, "yellow" )
    

    Note: conditional formatting applies to values only (not dimension columns) and values that exists (for example, the table must have a row for John and Asia even if the value is zero)

     

1 Reply

  • Hi Anonymous ,

     

    Create a measure to get the subtotal by user:

    Subtotal by User =
    CALCULATE ( SUM ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[user] ) )
    

    You can now then use this measure in conditional formatting based on rules

    Alternatively, you can use another conditional formatting measure and format based on field value

    Conditional Formatting = 
    IF ( [Subtotal by User] <= 12, "yellow" )
    

    Note: conditional formatting applies to values only (not dimension columns) and values that exists (for example, the table must have a row for John and Asia even if the value is zero)