Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Conditional Formatting based on calculated column inc + and - returned results

Hello

 

I'm trying to change the background colour of a cell which is a returned result of a calculated column based on data from two other columns.

 

Background: I have a column of scheduled arrival, a column of actual arrival and a calculated column of how many minutes late/early it was.

 

I'd like to make the cell showing the early/late minutes Green for early/on time (a minus value), Amber for up to 5 minutes late and Red for 5 minutes + late.

 

The cells look like this:

 

Sch Arrival     Actual Arrival     Diff

8:00:00 AM    8:02:00 AM        2 mins

8:00:00 AM    7:59:00 AM        -1 mins

 

If it matters, the DAX function for the Diff column is as follows:

 

= Duration.ToRecord ([Arrival]-[Sch. Arrival])

 

Would anyone be able to point me in the right direction please? I've tried all of the in built conditional formatting options but they seem to based off the count of a column which doesn't work for me in this example.

 

Thank you!

  • Anonymous 

    You can write a measure that you will use just to format your text.

    Format Measure = MAX ( 'Table'[Diff] )

    Then in the conditional formatting you apply the rules to that field.

7 Replies

  • Anonymous 

    You can write a measure that you will use just to format your text.

    Format Measure = MAX ( 'Table'[Diff] )

    Then in the conditional formatting you apply the rules to that field.