Forum Discussion

cooksteve09's avatar
cooksteve09
Frequent Visitor
4 years ago
Solved

Conditional Formatting using calculated measure

Please help!!   What i am after seeing in the "If_Red" column is, if the value has increased on previous week then green, red if decrease and blue if equal, below is an example of my data and my ca...
  • V-lianl-msft's avatar
    V-lianl-msft
    4 years ago

    Please try:

     

    Column = 
    var current_ = 'Table'[Index]
    var next = current_+1
    var base_line = MAX('Table'[Index])
    var current_value = 'Table'[filled]
    var next_value = CALCULATE(SUM('Table'[filled]),FILTER('Table','Table'[Index]=next))
    return SWITCH(TRUE(),
    'Table'[Index]=base_line,"black",
        current_value>next_value,"green",
        current_value<next_value,"red",
        current_value=next_value,"blue"
        )